Commit 1af3dd1f7a1e0c22410e5995d98a61848464d36c

Authored by Aresn
Committed by GitHub
2 parents 4ffec807 f7caa832

Merge pull request #2722 from GLChan/patch-1

Update cascader.vue
Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
src/components/cascader/cascader.vue
... ... @@ -219,7 +219,9 @@
219 219 }
220 220 }
221 221 getSelections(this.data);
222   - selections = selections.filter(item => item.label.indexOf(this.query) > -1).map(item => {
  222 + selections = selections.filter(item => {
  223 + return item.label ? item.label.indexOf(this.query) > -1 : false
  224 + }).map(item => {
223 225 item.display = item.display.replace(new RegExp(this.query, 'g'), `<span>${this.query}</span>`);
224 226 return item;
225 227 });
... ...