Cascader: fix 'v-model' directives require the attribute value which is valid as LHS.

pull/21468/head
王叨叨 2021-11-16 11:18:46 +08:00
parent d6dedac2e2
commit e585d7b04b
1 changed files with 13 additions and 1 deletions

View File

@ -14,7 +14,7 @@
<el-input
ref="input"
v-model="multiple ? presentText : inputValue"
v-model="realModel"
:size="realSize"
:placeholder="placeholder"
:readonly="readonly"
@ -296,6 +296,18 @@ export default {
},
panel() {
return this.$refs.panel;
},
realModel: {
get() {
return this.multiple ? this.presentText : this.inputValue;
},
set(val) {
if (this.multiple) {
this.presentText = val;
} else {
this.inputValue = val;
}
}
}
},