From f7caa832a7ef97194f2a6cdbb0727f02c3c83528 Mon Sep 17 00:00:00 2001 From: GLChen Date: Fri, 29 Dec 2017 22:44:53 +0800 Subject: [PATCH] Update cascader.vue --- src/components/cascader/cascader.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/cascader/cascader.vue b/src/components/cascader/cascader.vue index 16dfc70..2389252 100644 --- a/src/components/cascader/cascader.vue +++ b/src/components/cascader/cascader.vue @@ -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'), `${this.query}`); return item; }); -- libgit2 0.21.4