2023-03-03 15:54:28 +00:00
|
|
|
<script setup>
|
2023-10-31 14:38:43 +00:00
|
|
|
import { ref, watch } from 'vue';
|
2023-03-03 15:54:28 +00:00
|
|
|
|
|
|
|
defineProps({
|
2023-10-31 14:38:43 +00:00
|
|
|
type: {
|
|
|
|
type: String,
|
|
|
|
default: 'td',
|
|
|
|
},
|
|
|
|
});
|
2023-03-03 15:54:28 +00:00
|
|
|
|
2023-10-31 14:38:43 +00:00
|
|
|
const emit = defineEmits(['checked']);
|
2023-03-03 15:54:28 +00:00
|
|
|
|
2023-10-31 14:38:43 +00:00
|
|
|
const checked = ref(false);
|
2023-03-03 15:54:28 +00:00
|
|
|
|
2023-10-31 14:38:43 +00:00
|
|
|
watch(checked, (newVal) => {
|
|
|
|
emit('checked', newVal);
|
|
|
|
});
|
2023-03-03 15:54:28 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-10-31 14:38:43 +00:00
|
|
|
<component :is="type" class="lg:w-1">
|
|
|
|
<label class="checkbox">
|
|
|
|
<input v-model="checked" type="checkbox" />
|
|
|
|
<span class="check" />
|
|
|
|
</label>
|
|
|
|
</component>
|
2023-03-03 15:54:28 +00:00
|
|
|
</template>
|