From c5c050a52ad50dd2f89d21553e0a537834ddf9da Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Wed, 7 Sep 2016 18:38:51 +0800 Subject: [PATCH] update footer-nav --- examples/components/footer-nav.vue | 4 ++- packages/select/src/select.vue | 40 ++++++++++++++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/examples/components/footer-nav.vue b/examples/components/footer-nav.vue index 66c60883e..9db5eba23 100644 --- a/examples/components/footer-nav.vue +++ b/examples/components/footer-nav.vue @@ -30,6 +30,7 @@ } & i { + transition: .3s; color: #d9def1; vertical-align: baseline; } @@ -37,6 +38,7 @@ .footer-nav-link { cursor: pointer; + transition: .3s; &:hover { color: #5e6d82; @@ -101,5 +103,5 @@ this.nav = this.nav.concat(navConfig[1].children); this.updateNav(); } - } + }; \ No newline at end of file diff --git a/packages/select/src/select.vue b/packages/select/src/select.vue index 88883b6ba..dc1b488f7 100644 --- a/packages/select/src/select.vue +++ b/packages/select/src/select.vue @@ -183,29 +183,31 @@ this.valueChangeBySelected = false; return; } - if (this.multiple && Array.isArray(val)) { - this.$nextTick(() => { - this.resetInputHeight(); - }); - this.selectedInit = true; - this.selected = []; - val.forEach(item => { - let option = this.options.filter(option => option.value === item)[0]; + this.$nextTick(() => { + if (this.multiple && Array.isArray(val)) { + this.$nextTick(() => { + this.resetInputHeight(); + }); + this.selectedInit = true; + this.selected = []; + val.forEach(item => { + let option = this.options.filter(option => option.value === item)[0]; + if (option) { + this.$emit('addOptionToValue', option); + } + }); + } + if (!this.multiple) { + let option = this.options.filter(option => option.value === val)[0]; if (option) { this.$emit('addOptionToValue', option); + } else { + this.selected = {}; + this.selectedLabel = ''; } - }); - } - if (!this.multiple) { - let option = this.options.filter(option => option.value === val)[0]; - if (option) { - this.$emit('addOptionToValue', option); - } else { - this.selected = {}; - this.selectedLabel = ''; } - } - this.resetHoverIndex(); + this.resetHoverIndex(); + }); }, selected(val) {