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] 修复RadioGroup只能在使用v-model绑定的情况下才能正常使用的bug。 --- 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 6cd4ffe..cf692cf 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(); + } } } }; -- libgit2 0.21.4