fix: radioGroup not take effect when value is the number 0 #226

pull/263/head
tangjinzhou 2018-10-24 12:51:46 +08:00
parent 1ab2e106bf
commit 46b71b2e0a
1 changed files with 1 additions and 13 deletions

View File

@ -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: {