Commit 37322f8211e50c0ac93d9a951b30840540c5d616
Committed by
GitHub
Merge pull request #3498 from Superman379/patch-2
修复RadioGroup只能在使用v-model绑定的情况下才能正常使用的bug。
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
src/components/radio/radio-group.vue
| ... | ... | @@ -67,7 +67,7 @@ |
| 67 | 67 | this.childrens = findComponentsDownward(this, 'Radio'); |
| 68 | 68 | if (this.childrens) { |
| 69 | 69 | this.childrens.forEach(child => { |
| 70 | - child.currentValue = this.value === child.label; | |
| 70 | + child.currentValue = this.currentValue === child.label; | |
| 71 | 71 | child.group = true; |
| 72 | 72 | }); |
| 73 | 73 | } |
| ... | ... | @@ -82,8 +82,10 @@ |
| 82 | 82 | }, |
| 83 | 83 | watch: { |
| 84 | 84 | value () { |
| 85 | - this.currentValue = this.value; | |
| 86 | - this.updateValue(); | |
| 85 | + if(this.currentValue !== this.value){ | |
| 86 | + this.currentValue = this.value; | |
| 87 | + this.updateValue(); | |
| 88 | + } | |
| 87 | 89 | } |
| 88 | 90 | } |
| 89 | 91 | }; | ... | ... |