Merge pull request #2722 from GLChan/patch-1

Update cascader.vue
This commit is contained in:
Aresn 2018-01-08 14:51:50 +08:00 committed by GitHub
commit 1af3dd1f7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,7 +219,9 @@
}
}
getSelections(this.data);
selections = selections.filter(item => item.label.indexOf(this.query) > -1).map(item => {
selections = selections.filter(item => {
return item.label ? item.label.indexOf(this.query) > -1 : false
}).map(item => {
item.display = item.display.replace(new RegExp(this.query, 'g'), `<span>${this.query}</span>`);
return item;
});