修改一直问题
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
placeholder: String,
|
||||
triggerChange: Boolean,
|
||||
disabled: Boolean,
|
||||
db_field_name:String,
|
||||
value: [String, Number],
|
||||
type: String,
|
||||
getPopupContainer:{
|
||||
@@ -94,11 +95,17 @@
|
||||
}else{
|
||||
val = e
|
||||
}
|
||||
console.log(val)
|
||||
let content = ''
|
||||
this.dictOptions.forEach(res=>{
|
||||
if (res.value == e){
|
||||
content = res.text || res.label
|
||||
}
|
||||
})
|
||||
if(this.triggerChange){
|
||||
this.$emit('change', val);
|
||||
}else{
|
||||
this.$emit('input', val);
|
||||
this.$emit('changeQuery', content,this.db_field_name);
|
||||
}
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
placeholder: String,
|
||||
disabled: Boolean,
|
||||
value: String,
|
||||
db_field_name:String,
|
||||
type: String,
|
||||
options:Array,
|
||||
spliter:{
|
||||
@@ -104,7 +105,16 @@
|
||||
|
||||
},
|
||||
onChange (selectedValue) {
|
||||
let content = []
|
||||
this.dictOptions.forEach(res=>{
|
||||
selectedValue.forEach(val=>{
|
||||
if (res.value == val){
|
||||
content.push(res.text || res.label)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.$emit('change', selectedValue.join(this.spliter));
|
||||
this.$emit('changeQuery', content.join(this.spliter),this.db_field_name);
|
||||
},
|
||||
setCurrentDictOptions(dictOptions){
|
||||
this.dictOptions = dictOptions
|
||||
|
||||
Reference in New Issue
Block a user