Update select.vue

This commit is contained in:
YikaJ 2017-02-09 20:01:50 +08:00 committed by GitHub
parent 4e85fa156c
commit 7db4e70de2

View file

@ -480,23 +480,23 @@
this.query = query;
},
modelToQuery() {
if (!this.multiple && this.filterable && this.model) {
this.findChild((child) => {
if (this.model === child.value) {
if (child.label) {
this.query = child.label;
} else if (child.searchLabel) {
this.query = child.searchLabel;
} else {
this.query = child.value;
}
}
});
}
if (!this.multiple && this.filterable && this.model) {
this.findChild((child) => {
if (this.model === child.value) {
if (child.label) {
this.query = child.label;
} else if (child.searchLabel) {
this.query = child.searchLabel;
} else {
this.query = child.value;
}
}
});
}
}
},
compiled () {
this.modelToQuery()
this.modelToQuery();
this.updateOptions(true);
document.addEventListener('keydown', this.handleKeydown);
@ -504,6 +504,7 @@
// watch slot changed
if (MutationObserver) {
this.observer = new MutationObserver(() => {
this.modelToQuery();
this.slotChange();
this.updateOptions(true, true);
});
@ -524,7 +525,7 @@
},
watch: {
model () {
this.modelToQuery()
this.modelToQuery();
if (this.multiple) {
if (this.slotChangeDuration) {
this.slotChangeDuration = false;