Merge pull request #1 from YikaJ/YikaJ-select-fixed

更新 Select 组件
This commit is contained in:
YikaJ 2017-02-09 11:53:32 +08:00 committed by GitHub
commit f789787fd6

View file

@ -478,9 +478,8 @@
setQuery (query) { setQuery (query) {
if (!this.filterable) return; if (!this.filterable) return;
this.query = query; this.query = query;
}
}, },
compiled () { modelToQuery() {
if (!this.multiple && this.filterable && this.model) { if (!this.multiple && this.filterable && this.model) {
this.findChild((child) => { this.findChild((child) => {
if (this.model === child.value) { if (this.model === child.value) {
@ -494,6 +493,10 @@
} }
}); });
} }
}
},
compiled () {
this.modelToQuery()
this.updateOptions(true); this.updateOptions(true);
document.addEventListener('keydown', this.handleKeydown); document.addEventListener('keydown', this.handleKeydown);
@ -521,6 +524,7 @@
}, },
watch: { watch: {
model () { model () {
this.modelToQuery()
if (this.multiple) { if (this.multiple) {
if (this.slotChangeDuration) { if (this.slotChangeDuration) {
this.slotChangeDuration = false; this.slotChangeDuration = false;