This commit is contained in:
梁灏 2017-09-14 15:49:37 +08:00
parent 8c4cc38379
commit e1b86bcf73
3 changed files with 102 additions and 17 deletions

View file

@ -63,10 +63,14 @@
queryChange (val) {
const parsedQuery = val.replace(/(\^|\(|\)|\[|\]|\$|\*|\+|\.|\?|\\|\{|\}|\|)/g, '\\$1');
this.hidden = !new RegExp(parsedQuery, 'i').test(this.searchLabel);
},
// 使 key SearchLabel #1865
updateSearchLabel () {
this.searchLabel = this.$el.innerHTML;
}
},
mounted () {
this.searchLabel = this.$el.innerHTML;
this.updateSearchLabel();
this.dispatch('iSelect', 'append');
this.$on('on-select-close', () => {
this.isFocus = false;

View file

@ -627,6 +627,7 @@
this.$nextTick(() => this.broadcastQuery(''));
} else {
this.findChild((child) => {
child.updateSearchLabel(); // #1865
child.selected = this.multiple ? this.model.indexOf(child.value) > -1 : this.model === child.value;
});
}