Browse Source

2024-1-5 数据字典组件封装优化

master
zelian_wu 2 years ago
parent
commit
870200fdac
  1. 15
      src/views/modules/sys/dict-data-select.vue

15
src/views/modules/sys/dict-data-select.vue

@ -27,10 +27,20 @@ export default {
options: []
}
},
updated() {
this.dictDefaultValue()
},
created () {
this.initOption()
},
methods: {
dictDefaultValue(){
// value ,value
if (!this.value && this.options.length > 0){
let find = this.options.find(item=>item.isDefault === 'Y');
this.$emit("change",find.dictValue);
}
},
//options
async initOption () {
//
@ -44,11 +54,6 @@ export default {
if (data && data.code === 0){
this.options = data.rows;
}
// value ,value
if (!this.value && this.options.length > 0){
let find = this.options.find(item=>item.isDefault === 'Y');
this.$emit("change",find.dictValue);
}
},
// el-select @change,
changeDictData(val){

Loading…
Cancel
Save