fix: radioGroup not take effect when value is the number 0 #226
parent
1ab2e106bf
commit
46b71b2e0a
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue