Files
chatwoot/app/javascript/v3/components/Form/CheckBox.vue
2025-07-01 09:43:44 +05:30

32 lines
819 B
Vue

<script setup>
import { computed } from 'vue';
const props = defineProps({
isChecked: {
type: Boolean,
default: false,
},
value: {
type: String,
default: null,
},
});
const emit = defineEmits(['update']);
const checked = computed({
get: () => props.isChecked,
set: value => emit('update', props.value, value),
});
</script>
<template>
<input
:id="value"
v-model="checked"
type="checkbox"
:value="value"
class="flex-shrink-0 mt-0.5 border-n-strong border bg-n-slate-2 checked:border-none checked:bg-n-brand shadow-sm appearance-none rounded-[4px] w-4 h-4 focus:ring-1 after:content-[''] after:text-white checked:after:content-['✓'] after:flex after:items-center after:justify-center after:text-center after:text-xs after:font-bold after:relative"
/>
</template>