Update cascader.vue

This commit is contained in:
GLChen 2017-12-29 22:44:53 +08:00 committed by GitHub
parent 6b2cd6742a
commit f7caa832a7
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;
});