Skip to content

Commit

Permalink
fix: radio value is not updated, close BewlyBewly#717
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed May 6, 2024
1 parent 7cca4ed commit 5adaf14
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/components/Radio.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
<script lang="ts" setup>
const props = defineProps<{
defineProps<{
modelValue: boolean
label?: string
}>()
const emit = defineEmits(['update:modelValue'])
const modelValue = ref<boolean>()
watch(() => modelValue.value, (newValue) => {
emit('update:modelValue', newValue)
})
onMounted(() => {
modelValue.value = props.modelValue
})
const model = defineModel()
</script>

<template>
<label cursor="pointer" pointer="auto" flex items-center gap-3>
<span>{{ label }}</span>
<input v-model="modelValue" type="checkbox" hidden>
<input v-model="model" type="checkbox" hidden>
<span
inline-block w="$b-button-width" h="$b-button-height" bg="$bew-fill-1" rounded="[calc(var(--b-button-height)/2)]"
relative border="size-$b-border-width color-$bew-border-color"
Expand Down

0 comments on commit 5adaf14

Please sign in to comment.