From 47089bf35a5c86199f178f974efedc19d81bf7ab Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Fri, 16 Sep 2022 12:13:25 +0800 Subject: [PATCH] =?UTF-8?q?amis-saas-6877=20[Bug]=20=E3=80=8Camis=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E3=80=8D=E5=AE=B9=E5=99=A8=E5=86=85=E6=94=BE?= =?UTF-8?q?=E7=BD=AEservice=E7=BB=84=E4=BB=B6=E5=87=BA=E7=8E=B0=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I32c612d545554c6be6555cfdb272bec8d0f450e4 --- packages/amis-editor-core/src/component/factory.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/amis-editor-core/src/component/factory.tsx b/packages/amis-editor-core/src/component/factory.tsx index e08228f76..24267a9a2 100644 --- a/packages/amis-editor-core/src/component/factory.tsx +++ b/packages/amis-editor-core/src/component/factory.tsx @@ -82,11 +82,10 @@ export function makeWrapper( closestScope = manager.dataSchema.getScope( `${from.id}-${from.type}` ); - } else if (!from.parent) { - closestScope = manager.dataSchema.getScope('root'); - } + } - from = from.parent; + // node.parent 是找不到 root 那层的,所以需要自己加逻辑 + from = from.parentId === 'root' ? store.root : from.parent; } if (closestScope) {