tethys.backend/resources/js/Components/TableCheckboxCell.vue

34 lines
482 B
Vue
Raw Normal View History

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