You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and dots ('.'), can be up to 35 characters long. Letters must be lowercase.
34 lines
612 B
34 lines
612 B
<script setup> |
|
import { computed } from 'vue'; |
|
|
|
const emit = defineEmits(['update:checked']); |
|
|
|
const props = defineProps({ |
|
checked: { |
|
type: [Array, Boolean], |
|
required: true, |
|
}, |
|
value: { |
|
default: null, |
|
}, |
|
}); |
|
|
|
const proxyChecked = computed({ |
|
get() { |
|
return props.checked; |
|
}, |
|
|
|
set(val) { |
|
emit('update:checked', val); |
|
}, |
|
}); |
|
</script> |
|
|
|
<template> |
|
<input |
|
type="checkbox" |
|
:value="value" |
|
v-model="proxyChecked" |
|
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:ring-indigo-500" |
|
/> |
|
</template>
|
|
|