【修改】修复字典多选数据更新代码不更新的bug
This commit is contained in:
@@ -13,15 +13,16 @@
|
||||
:getPopupContainer="getParentContainer"
|
||||
optionFilterProp="children"
|
||||
:filterOption="filterOption"
|
||||
allowClear>
|
||||
<a-select-option
|
||||
v-for="(item,index) in dictOptions"
|
||||
:key="index"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
|
||||
{{ item.text || item.label }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
allowClear
|
||||
:options="dictOptions">
|
||||
<!-- <a-select-option-->
|
||||
<!-- v-for="(item,index) in dictOptions"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- :value="item.value">-->
|
||||
<!-- <span style="display: inline-block;width: 100%" :title=" item.text || item.label ">-->
|
||||
<!-- {{ item.text || item.label }}-->
|
||||
<!-- </span>-->
|
||||
<!-- </a-select-option>-->
|
||||
</a-select>
|
||||
|
||||
</template>
|
||||
@@ -62,11 +63,13 @@
|
||||
this.tagType = this.type
|
||||
}
|
||||
//获取字典数据
|
||||
//this.initDictData();
|
||||
// this.initDictData();
|
||||
},
|
||||
watch:{
|
||||
options: function(val){
|
||||
this.setCurrentDictOptions(val);
|
||||
options (val) {
|
||||
val.forEach((item, index) => {
|
||||
this.$set(this.dictOptions, index, item)
|
||||
})
|
||||
},
|
||||
dictCode:{
|
||||
immediate:true,
|
||||
@@ -103,14 +106,8 @@
|
||||
|
||||
},
|
||||
onChange (selectedValue) {
|
||||
this.value = selectedValue.join(this.spliter);
|
||||
this.$emit('change', this.value);
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
this.dictOptions = dictOptions
|
||||
},
|
||||
getCurrentDictOptions(){
|
||||
return this.dictOptions
|
||||
this.arrayValue = selectedValue;
|
||||
this.$emit('change', selectedValue.join(this.spliter));
|
||||
},
|
||||
getParentContainer(node){
|
||||
if(!this.popContainer){
|
||||
|
||||
Reference in New Issue
Block a user