From ebbbeb4c856086e6e24bfe241ea97f35d8ae541c Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sun, 5 Jul 2026 18:22:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=AF=BC=E5=9B=BE):=20Array.map=20?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E5=A4=9A=E5=8F=82=E6=95=B0=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=20ancestors=20=E9=BB=98=E8=AE=A4=E5=80=BC=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .map(toElixirNode) 传递 (item, index, array) 三个参数, index 作为数字覆盖 ancestors 默认值 [],导致 [...ancestors] 报错。 改为箭头函数只传第一个参数。 --- src/components/MindMapViewer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MindMapViewer.vue b/src/components/MindMapViewer.vue index 2d31465..29d17d2 100644 --- a/src/components/MindMapViewer.vue +++ b/src/components/MindMapViewer.vue @@ -103,7 +103,7 @@ const toElixirData = (tree: MindMapTreeNode): MindElixirData => { nodeData: { id: "root", topic: tree.title || "思维导图", - children: (tree.children || []).map(toElixirNode), + children: (tree.children || []).map(c => toElixirNode(c)), }, } as MindElixirData; };