From 89828b5b9c866d34c7d7a58c0243a26ea1ff3f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Sat, 9 Sep 2017 18:01:46 +0800 Subject: [PATCH] update Select --- examples/routers/select.vue | 107 +++++++++++++++++++++---------- src/components/select/select.vue | 16 ++--- 2 files changed, 79 insertions(+), 44 deletions(-) diff --git a/examples/routers/select.vue b/examples/routers/select.vue index 0d0b4b06..6900d5bf 100644 --- a/examples/routers/select.vue +++ b/examples/routers/select.vue @@ -1,46 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/select/select.vue b/src/components/select/select.vue index d6bc8d61..42174e0b 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -285,7 +285,7 @@ }); } }, - updateOptions (init, slot = false) { + updateOptions (slot = false) { let options = []; let index = 1; @@ -296,18 +296,14 @@ }); child.index = index++; - if (init) { - this.optionInstances.push(child); - } + this.optionInstances.push(child); }); this.options = options; - if (init) { - if (!this.remote) { - this.updateSingleSelected(true, slot); - this.updateMultipleSelected(true, slot); - } + if (!this.remote) { + this.updateSingleSelected(true, slot); + this.updateMultipleSelected(true, slot); } }, updateSingleSelected (init = false, slot = false) { @@ -635,7 +631,7 @@ }); } this.slotChange(); - this.updateOptions(true, true); + this.updateOptions(true); }); }, // 处理 remote 初始值