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

Merge pull request #61 from slgluo/2.x-beta

fix: 修复权限树只选择一项权限时会清空所有权限的问题
This commit is contained in:
大脸怪 2023-12-18 09:50:19 +08:00 committed by GitHub
commit 925c0afba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)