From d44f99fd15dab6d8ab66f8b174768cf369d527d9 Mon Sep 17 00:00:00 2001 From: Wu-K'ung <2292884238@qq.com> Date: Thu, 26 Apr 2018 11:19:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8DRadioGroup=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E5=9C=A8=E4=BD=BF=E7=94=A8v-model=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E6=89=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E4=BD=BF=E7=94=A8=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用:value绑定的时候,RadioGroup并不能正常切换。 --- src/components/radio/radio-group.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/radio/radio-group.vue b/src/components/radio/radio-group.vue index 6cd4ffea..cf692cf7 100644 --- a/src/components/radio/radio-group.vue +++ b/src/components/radio/radio-group.vue @@ -67,7 +67,7 @@ this.childrens = findComponentsDownward(this, 'Radio'); if (this.childrens) { this.childrens.forEach(child => { - child.currentValue = this.value === child.label; + child.currentValue = this.currentValue === child.label; child.group = true; }); } @@ -82,8 +82,10 @@ }, watch: { value () { - this.currentValue = this.value; - this.updateValue(); + if(this.currentValue !== this.value;){ + this.currentValue = this.value; + this.updateValue(); + } } } }; From 0b026efe2a227b709d962df023ac28917b36fe7f Mon Sep 17 00:00:00 2001 From: Wu-K'ung <2292884238@qq.com> Date: Thu, 26 Apr 2018 14:45:59 +0800 Subject: [PATCH 2/2] Update radio-group.vue --- src/components/radio/radio-group.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/radio/radio-group.vue b/src/components/radio/radio-group.vue index cf692cf7..59d15355 100644 --- a/src/components/radio/radio-group.vue +++ b/src/components/radio/radio-group.vue @@ -82,7 +82,7 @@ }, watch: { value () { - if(this.currentValue !== this.value;){ + if(this.currentValue !== this.value){ this.currentValue = this.value; this.updateValue(); }