From 6e48fa50cf287ae8bd325a6e40581df96cdf95e1 Mon Sep 17 00:00:00 2001 From: weicw <594098497@qq.com> Date: Thu, 5 Nov 2026 19:19:35 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E5=9B=9E=E6=98=BE=E6=97=B6=E9=80=92=E5=BD=92?= =?UTF-8?q?=E5=8F=96=E6=95=B4=E6=A3=B5=E6=A0=91=E5=AF=BC=E8=87=B4=E6=A0=88?= =?UTF-8?q?=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mixins/organization-search.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mixins/organization-search.js b/src/mixins/organization-search.js index fd06b59..7a69e9d 100644 --- a/src/mixins/organization-search.js +++ b/src/mixins/organization-search.js @@ -143,7 +143,9 @@ export default { for (const node of tree || []) { const path = [...parents, String(node.id)]; if (String(node.id) === String(target)) return path; - const matched = this.findOrgPath(target, node.children, path); + // 必须显式传 node.children || []:叶节点的 children 是 undefined, + // 传 undefined 会触发默认参数重新拿到整棵树,逐层重复扫描直到爆栈 + const matched = this.findOrgPath(target, node.children || [], path); if (matched) return matched; } return null;