This commit is contained in:
梁灏 2017-05-15 09:16:30 +08:00
parent 78d8ea4d4a
commit c70ff0f294
2 changed files with 11 additions and 7 deletions

View file

@ -118,6 +118,7 @@
selectedMultiple: [],
focusIndex: 0,
query: '',
lastQuery: '',
selectToChangeQuery: false, // when select an option, set this first and set query, because query is watching, it will emit event
inputLength: 20,
notFound: false,
@ -528,10 +529,10 @@
this.query = child.label === undefined ? child.searchLabel : child.label;
}
});
// remoteMethod
if (this.remote) {
// remoteMethod
if (this.remote && this.query !== this.lastQuery) {
this.$nextTick(() => {
this.query = model;
this.query = this.lastQuery;
});
}
} else {
@ -645,7 +646,7 @@
this.findChild((child) => {
if (child.value === value) {
if (this.query !== '') this.selectToChangeQuery = true;
this.query = child.label === undefined ? child.searchLabel : child.label;
this.lastQuery = this.query = child.label === undefined ? child.searchLabel : child.label;
}
});
}