We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0876f4 commit 6d88d79Copy full SHA for 6d88d79
app/components/Tag/RadioButton.vue
@@ -19,6 +19,11 @@ const uid = useId()
19
const internalId = `${model.value}-${uid}`
20
21
const checked = computed(() => model.value === props.value)
22
+
23
+/** Todo: This shouldn't be necessary, but using v-model on `input type=radio` doesn't work as expected in Vue */
24
+const onChange = () => {
25
+ model.value = props.value
26
+}
27
</script>
28
29
<template>
@@ -40,8 +45,9 @@ const checked = computed(() => model.value === props.value)
40
45
:name="props.value"
41
46
:id="internalId"
42
47
:value="props.value"
43
- v-model="model"
48
+ :checked="checked"
44
49
:disabled="props.disabled ? true : undefined"
50
+ @change="onChange"
51
/>
52
<slot />
53
</label>
0 commit comments