From e2006187555d81bb86440e2c05d3d33a812ca1a8 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Tue, 3 Jan 2017 12:05:25 +0800 Subject: [PATCH] fixed #159 --- src/components/select/select.vue | 14 ++++++++++++++ test/routers/select.vue | 13 +++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 8208b34..035eb13 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -466,6 +466,20 @@ } }, ready () { + if (!this.multiple && this.filterable && this.model) { + this.findChild((child) => { + if (this.model === child.value) { + if (child.label) { + this.query = child.label; + } else if (child.searchLabel) { + this.query = child.searchLabel; + } else { + this.query = child.value; + } + } + }); + } + this.updateOptions(true); document.addEventListener('keydown', this.handleKeydown); diff --git a/test/routers/select.vue b/test/routers/select.vue index 4606476..a1ede98 100644 --- a/test/routers/select.vue +++ b/test/routers/select.vue @@ -1,8 +1,7 @@