From bfa115f31e5dcf32b6b00e137d81cb96a9865f3b Mon Sep 17 00:00:00 2001 From: junbaibai <1355767057@qq.com> Date: Sat, 4 Jan 2025 20:58:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A2=84=E8=A7=88=E9=A1=B5=E5=8F=AA?= =?UTF-8?q?=E4=BC=9A=E5=8A=A0=E8=BD=BD=E7=AC=AC=E4=B8=80=E9=A1=B5=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E9=A1=B5=E6=89=BE=E4=B8=8D=E5=88=B0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo-workspace/src/preview.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/demo-workspace/src/preview.tsx b/demo-workspace/src/preview.tsx index 534af6a0..0dc84ab5 100644 --- a/demo-workspace/src/preview.tsx +++ b/demo-workspace/src/preview.tsx @@ -37,9 +37,18 @@ const SamplePreview = () => { dataSource: projectDataSource, } = projectSchema; const componentsMap: any = {}; - componentsMapArray.forEach((component: any) => { - componentsMap[component.componentName] = component; + + resourceList.forEach(({ id }) => { + const projectSchema = getProjectSchemaFromLocalStorage(scenarioName, id); + const { + componentsMap: componentsMapArray, + } = projectSchema; + componentsMapArray.forEach((component: any) => { + componentsMap[component.componentName] = component; + }); }); + + const pageSchema = componentsTree[0]; const libraryMap = {};