1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-04-30 22:29:01 +08:00

fix: 修复权限树只选择一项权限时会清空所有权限的问题

This commit is contained in:
sunlg 2023-12-17 21:24:12 +08:00
parent fc6df74d9e
commit a22d1f84ea

View File

@ -46,7 +46,7 @@ const emit = defineEmits(['update:value'])
const halfCheckedKeys = ref([])
const checkedKeys = ref([])
watch([halfCheckedKeys, checkedKeys], ([v1, v2]) => {
emit('update:value', new Array(...new Set([...v1, ...v2])))
emit('update:value', Array.from(new Set([...v1, ...v2])))
})
onMounted(() => {
halfCheckedKeys.value = getHalfCheckedValues(props.value, props.treeData)