From 0fb9d6453a317e5a8a7d589b3073f75df1541463 Mon Sep 17 00:00:00 2001 From: 郑敏 Date: Sun, 3 Jun 2018 23:18:29 +0800 Subject: [PATCH] fix bug #3795 --- src/components/select/select.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index ad2fc02..feaff4d 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -230,8 +230,8 @@ }).filter(Boolean); } - if (this.values.length > 0 && this.selectOptions.length === 0){ - this.hasExpectedValue = this.values; + if (this.getInitialValue().length > 0 && this.selectOptions.length === 0){ + this.hasExpectedValue = true; } }, data () { @@ -716,7 +716,10 @@ this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper'); }, selectOptions(){ - if (this.hasExpectedValue){ + if (this.hasExpectedValue && this.selectOptions.length > 0){ + if (this.values.length === 0) { + this.values = this.getInitialValue(); + } this.values = this.values.map(this.getOptionData).filter(Boolean); this.hasExpectedValue = false; } -- libgit2 0.21.4