og-image/src/ui/CheckboxForm.vue
Simon Vieille a1df4d8967
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
add 'allowHtml' option
2023-04-02 18:13:39 +02:00

39 lines
782 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'"
: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>