From 7fb4d96cb0c66a8f4c1010764ec2f986abec1cf4 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 30 May 2024 17:23:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E5=B7=B2=E9=80=89=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=91=E4=B8=AD=E5=A6=82=E6=9E=9C=E5=87=BA=E7=8E=B0?= =?UTF-8?q?items=E4=B8=8D=E6=98=AF=E6=95=B0=E7=BB=84=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=8A=82=E7=82=B9=E6=B8=B2=E6=9F=93=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/components/TreeNode.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/TreeNode.vue b/packages/editor/src/components/TreeNode.vue index 2b7843a20..bd0fc4012 100644 --- a/packages/editor/src/components/TreeNode.vue +++ b/packages/editor/src/components/TreeNode.vue @@ -114,7 +114,9 @@ const selected = computed(() => nodeStatus.value.selected); const visible = computed(() => nodeStatus.value.visible); const draggable = computed(() => nodeStatus.value.draggable); -const hasChildren = computed(() => props.data.items?.some((item) => props.nodeStatusMap.get(item.id)?.visible)); +const hasChildren = computed( + () => Array.isArray(props.data.items) && props.data.items.some((item) => props.nodeStatusMap.get(item.id)?.visible), +); const handleDragStart = (event: DragEvent) => { treeEmit?.('node-dragstart', event, props.data);