From 46b71b2e0a1784af84611651b7a5de0f8f17d843 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Wed, 24 Oct 2018 12:51:46 +0800 Subject: [PATCH] fix: radioGroup not take effect when value is the number 0 #226 --- components/radio/Group.jsx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/components/radio/Group.jsx b/components/radio/Group.jsx index 9f3616d3e..1f7674e7b 100644 --- a/components/radio/Group.jsx +++ b/components/radio/Group.jsx @@ -4,18 +4,6 @@ import Radio from './Radio' import { getOptionProps, filterEmpty, hasProp } from '../_util/props-util' function noop () {} -function getCheckedValue (children) { - let value = null - let matched = false - children.forEach((radio) => { - if (radio && radio.componentOptions && radio.componentOptions.propsData.checked) { - value = radio.componentOptions.propsData.value - matched = true - } - }) - return matched ? { value } : undefined -} - export default { name: 'ARadioGroup', props: { @@ -42,7 +30,7 @@ export default { data () { const { value, defaultValue } = this return { - stateValue: value || defaultValue, + stateValue: value === undefined ? defaultValue : value, } }, model: {