Commit f7caa832a7ef97194f2a6cdbb0727f02c3c83528

Authored by GLChen
Committed by GitHub
1 parent 6b2cd674

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 });
... ...