fix(components): [radio] change not trigger (#17047)

This commit is contained in:
qi 2024-08-07 16:02:02 +08:00 committed by GitHub
parent 61c828f493
commit b55163fde7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -379,5 +379,13 @@ describe('Radio Button', () => {
expect(radioGroup2.attributes()['aria-label']).toBe('Bar')
expect(radioGroup2.attributes()['aria-labelledby']).toBeFalsy()
})
test('value is number change event need checked', async () => {
const radio = ref(1)
const wrapper = mount(() => <Radio v-model={radio.value} label="1" />)
expect(wrapper.classes()).not.toContain('is-checked')
await wrapper.trigger('click')
expect(wrapper.classes()).toContain('is-checked')
})
})
})

View File

@ -23,6 +23,7 @@
:value="actualValue"
:name="name || radioGroup?.name"
:disabled="disabled"
:checked="modelValue === actualValue"
type="radio"
@focus="focus = true"
@blur="focus = false"