From 5bd34df5b36f74cb45bddca23d8e9aebeb167c38 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 8 Mar 2022 22:43:43 +0800 Subject: [PATCH] fix: deps and TypeScript types --- components/tree/DirectoryTree.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/tree/DirectoryTree.tsx b/components/tree/DirectoryTree.tsx index 8a3532ffa..63cd337c4 100644 --- a/components/tree/DirectoryTree.tsx +++ b/components/tree/DirectoryTree.tsx @@ -98,7 +98,7 @@ export default defineComponent({ initExpandedKeys = Object.keys(keyEntities); } else if (props.defaultExpandParent) { initExpandedKeys = conductExpandParent( - props.expandedKeys || props.defaultExpandedKeys, + props.expandedKeys || props.defaultExpandedKeys || [], keyEntities, ); } else { @@ -203,8 +203,8 @@ export default defineComponent({ }; // Windows / Mac single pick - const ctrlPick: boolean = nativeEvent.ctrlKey || nativeEvent.metaKey; - const shiftPick: boolean = nativeEvent.shiftKey; + const ctrlPick: boolean = nativeEvent?.ctrlKey || nativeEvent?.metaKey; + const shiftPick: boolean = nativeEvent?.shiftKey; // Generate new selected keys let newSelectedKeys: Key[];