Select: not clear text when filtering (#12304)

pull/12325/head
hetech 2018-08-10 15:28:22 +08:00 committed by GitHub
parent 4af2d8761d
commit 6f08e941aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -86,8 +86,14 @@
currentLabel() {
if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
},
value() {
if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
value(val, oldVal) {
const { remote, valueKey } = this.select;
if (!this.created && !remote) {
if (valueKey && typeof val === 'object' && typeof oldVal === 'object' && val[valueKey] === oldVal[valueKey]) {
return;
}
this.dispatch('ElSelect', 'setSelected');
}
}
},