import { defineComponent, inject, computed } from 'vue' import MdiCheckBold from './util/MdiCheckBold.vue' const checkbox = defineComponent({ name: 'Checkbox', props: { value: [String, Number, Boolean], checked: { type: Boolean, defalut: false, validator(value) { return typeof value == 'boolean' }, }, disabled: { type: Boolean, defalut: false, }, }, emits: ['update:checked'], setup(props, { slots, emit }) { const checkboxGroupContent = inject('checkboxGroupContent', undefined) const checkState = computed(() => { return ( props.checked || checkboxGroupContent?.props?.value.includes(props.value) ) }) const onClick = () => { emit('update:checked', !props.checked) checkboxGroupContent?.onCheckboxChange(props.value) } return () => (