feat(tree): 完成树形组件复选框功能

This commit is contained in:
落小梅
2021-10-14 16:39:06 +08:00
parent eef31c72af
commit 377171ab94
7 changed files with 82 additions and 71 deletions

View File

@@ -20,21 +20,20 @@ import { defineProps, useSlots } from 'vue'
const slot = useSlots()
const props =
defineProps<{
name?: string
skin?: string
label?: string
checked?: boolean
disabled?: boolean
}>()
const props = defineProps<{
name?: string
skin?: string
label?: string
checked?: boolean
disabled?: boolean
}>()
const emit = defineEmits(['update:checked', 'change'])
const handleClick = function () {
if (!props.disabled) {
emit('update:checked', !props.checked)
emit('change', { checked: !props.checked, value: props.label })
emit('update:checked', !props.checked)
emit('change', { checked: !props.checked, value: props.label })
}
}
</script>