og-image/src/ui/CheckboxForm.vue
Simon Vieille 271bd1a15e
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix CheckboxForm modelValue test
2024-04-18 20:28:17 +02:00

39 lines
805 B
Vue

<template>
<input
:id="id"
class="mr-2 rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
type="checkbox"
:checked="modelValue === 'true' || modelValue === true"
:class="$attrs.class"
@change="$emit('change', $event)"
@input="$emit('update:modelValue', $event.target.checked)"
>
<label
v-if="label"
class="text-sm font-medium text-gray-700"
:for="id"
v-text="label"
/>
</template>
<script>
export default {
props: {
modelValue: {
type: String,
default: null,
},
label: {
type: String,
default: null,
required: false,
},
id: {
type: String,
required: true,
},
},
emits: ['update:modelValue', 'change'],
}
</script>