马鞍山网站开发流程,中国互联网网站性能,网址域名ip查询子域名解析,购物网站设计欣赏目录 1.提出问题#xff1a;
1.1 代码#xff1a;
1.2 效果图#xff1a;会发现处在children下的dicUrl失效了
2. 解决思路 3. 解决代码#xff08;你要的都在这#xff0c;看这里#xff09; 1.提出问题#xff1a; 在使用avue-crud/组件实现二级表头时
1.1 代码
1.2 效果图会发现处在children下的dicUrl失效了
2. 解决思路 3. 解决代码你要的都在这看这里 1.提出问题 在使用avue-crud/组件实现二级表头时发现在children下配置字典项只有dicData可以生效、但是dicUrl不生效
1.1 代码 {label: 基站属性明细信息,children: [{type: input,label: 覆盖区域,prop: s7,dicUrl: /admin/dict/type/CoverAreas,},{type: input,label: 基站属性,prop: s8,dicUrl: /admin/dict/type/StationAttributes,},{type: input,label: 站址码,prop: s9,width: 80}]
}, 1.2 效果图会发现处在children下的dicUrl失效了 2. 解决思路 既然处在children下的dicUlr会失效那么我们可以单独把该属性拎出来那问题来了怎么拎这里使用插槽来实现。 注意 这个使用到avue自带的弹出框实现新增需要使用的是 “formslot” 表单插槽。 3. 解决代码你要的都在这看这里
const.js(tableOption): 在需要的属性上加上formslot: true {label: 基站属性明细信息,children: [{type: input,label: 覆盖区域,prop: s7,formslot: true,},{type: input,label: 基站属性,prop: s8,formslot: true,},{type: input,label: 站址码,prop: s9,width: 80}]},
index.vue: 注意插槽要在属性的的基础上加上xxxForm
templateavue-crudtemplate slots7Form slot-scope{row,index}el-selectstylewidth: 100% v-modelrow.s7clearable filterableplaceholder请输入el-optionv-for(item,index) in CoverageAreaList:keyindex:labelitem.label:valueitem.value/el-option/el-select/templatetemplate slots8Form slot-scope{row,index}el-selectstylewidth: 100% v-modelrow.s8clearable filterableplaceholder请输入el-optionv-for(item,index) in StationAttributes:keyindex:labelitem.label:valueitem.value/el-option/el-select/template/avue-crud
/template
scriptexport default {create(){getDICList(CoverageArea).then(res {this.CoverageAreaList res.data})getDICList(StationAttributes).then(res {this.StationAttributes res.data})getDICList(LargeCategory).then(res {this.LargeCategory res.data})}}
/script
api.js 后台需要将字典项查出来大家应该都知道后台代码就不提供了祝大家早日解决bug!!!
import request from /utils/request;export function getDICList(type) {return request({url: /admin/dict/type/ type,method: get})
} 如果能帮到你麻烦一键三连您的点赞是我更新的动力