mirror of https://github.com/ElemeFE/element
Cascader: fix 'v-model' directives require the attribute value which is valid as LHS.
parent
d6dedac2e2
commit
e585d7b04b
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
<el-input
|
<el-input
|
||||||
ref="input"
|
ref="input"
|
||||||
v-model="multiple ? presentText : inputValue"
|
v-model="realModel"
|
||||||
:size="realSize"
|
:size="realSize"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
|
@ -296,6 +296,18 @@ export default {
|
||||||
},
|
},
|
||||||
panel() {
|
panel() {
|
||||||
return this.$refs.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue