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

@ -496,7 +496,7 @@
} }
}, },
compiled () { compiled () {
this.modelToQuery() this.modelToQuery();
this.updateOptions(true); this.updateOptions(true);
document.addEventListener('keydown', this.handleKeydown); document.addEventListener('keydown', this.handleKeydown);
@ -504,6 +504,7 @@
// watch slot changed // watch slot changed
if (MutationObserver) { if (MutationObserver) {
this.observer = new MutationObserver(() => { this.observer = new MutationObserver(() => {
this.modelToQuery();
this.slotChange(); this.slotChange();
this.updateOptions(true, true); this.updateOptions(true, true);
}); });
@ -524,7 +525,7 @@
}, },
watch: { watch: {
model () { model () {
this.modelToQuery() this.modelToQuery();
if (this.multiple) { if (this.multiple) {
if (this.slotChangeDuration) { if (this.slotChangeDuration) {
this.slotChangeDuration = false; this.slotChangeDuration = false;