fix: 修复赋值菜单权限时,选保存了一个[1]

pull/27/head
xxqc 2023-07-05 13:48:03 +08:00
parent 684ab06102
commit 25593cc249
2 changed files with 3 additions and 2 deletions

View File

@ -85,7 +85,7 @@ export default defineComponent({
const rawVal = toRaw(state.checkedKeys) const rawVal = toRaw(state.checkedKeys)
emit('update:value', rawVal) emit('update:value', rawVal)
emit('check', rawVal, e) emit('check', state.checkStrictly ? rawVal.checked : rawVal, e)
}, },
onRightClick: handleRightClick onRightClick: handleRightClick
} }
@ -163,6 +163,7 @@ export default defineComponent({
function checkAll(checkAll: boolean) { function checkAll(checkAll: boolean) {
state.checkedKeys = checkAll ? getEnabledKeys() : ([] as KeyType[]) state.checkedKeys = checkAll ? getEnabledKeys() : ([] as KeyType[])
emit('check', state.checkedKeys, [])
} }
function expandAll(expandAll: boolean) { function expandAll(expandAll: boolean) {

View File

@ -114,7 +114,7 @@ function menuCheck(checkedKeys: CheckKeys, event: CheckedEvent) {
// ID // ID
menuKeys.value = checkedKeys as number[] menuKeys.value = checkedKeys as number[]
// ID // ID
menuHalfKeys.value = event.halfCheckedKeys as number[] menuHalfKeys.value = (event.halfCheckedKeys as number[]) || []
} }
} }
</script> </script>