avue-下拉框动态赋值

后台返回的数据是map类型,如图所示

无法用dicUrl方式,改用dicData数据字典

  mounted() {
        getCustomList2().then(res => {
            var column = this.findObject(this.option.column,'salesman');
            column.dicData= res.data.customs['专营业务员'];
            console.log(this.dic);
        })
    },

数据结构如下

// 专管业务员
                    {
                        label: "专管业务员",
                        prop: "salesman",
                        type: "select",
                        dicData:[],
                        props:{
                            value: "id",
                            label: "name",
                        },
                    },

 

posted @ 2022-07-20 17:41  820820820  阅读(2326)  评论(0)    收藏  举报