Skip to content

Commit 6d88d79

Browse files
committed
Revert "refacor: cleanup"
This reverts commit f0876f4.
1 parent f0876f4 commit 6d88d79

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/components/Tag/RadioButton.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ const uid = useId()
1919
const internalId = `${model.value}-${uid}`
2020
2121
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+
}
2227
</script>
2328

2429
<template>
@@ -40,8 +45,9 @@ const checked = computed(() => model.value === props.value)
4045
:name="props.value"
4146
:id="internalId"
4247
:value="props.value"
43-
v-model="model"
48+
:checked="checked"
4449
:disabled="props.disabled ? true : undefined"
50+
@change="onChange"
4551
/>
4652
<slot />
4753
</label>

0 commit comments

Comments
 (0)