From b6a260471d9369e9b911f35d16ff0fca82a7d4fe Mon Sep 17 00:00:00 2001 From: roymondchen Date: Fri, 20 Jun 2025 20:10:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor,react-runtime-help,vue-runtime-help)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E6=8B=96=E5=8A=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/src/layouts/page-bar/PageBarScrollContainer.vue | 2 +- runtime/react-runtime-help/package.json | 2 +- runtime/react-runtime-help/src/hooks/use-editor-dsl.ts | 6 ++++++ runtime/vue-runtime-help/package.json | 2 +- runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts | 6 ++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/layouts/page-bar/PageBarScrollContainer.vue b/packages/editor/src/layouts/page-bar/PageBarScrollContainer.vue index 6324ad44..37d1d139 100644 --- a/packages/editor/src/layouts/page-bar/PageBarScrollContainer.vue +++ b/packages/editor/src/layouts/page-bar/PageBarScrollContainer.vue @@ -136,7 +136,7 @@ watch( let beforeDragList: Id[] = []; const options = { ...{ - dataIdAttr: 'page-id', // 获取排序后的数据 + dataIdAttr: 'data-page-id', // 获取排序后的数据 onStart: async (event: SortableEvent) => { if (typeof props.pageBarSortOptions?.beforeStart === 'function') { await props.pageBarSortOptions.beforeStart(event, sortable); diff --git a/runtime/react-runtime-help/package.json b/runtime/react-runtime-help/package.json index eac87c9e..61a1b0b2 100644 --- a/runtime/react-runtime-help/package.json +++ b/runtime/react-runtime-help/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.0", + "version": "0.1.1", "name": "@tmagic/react-runtime-help", "type": "module", "sideEffects": false, diff --git a/runtime/react-runtime-help/src/hooks/use-editor-dsl.ts b/runtime/react-runtime-help/src/hooks/use-editor-dsl.ts index 366943e8..b0f3eff3 100644 --- a/runtime/react-runtime-help/src/hooks/use-editor-dsl.ts +++ b/runtime/react-runtime-help/src/hooks/use-editor-dsl.ts @@ -50,7 +50,13 @@ export const useEditorDsl = (app: TMagicApp, renderDom: () => void) => { }, update({ config, root, parentId }: UpdateData) { + if (config.type === 'app') { + this.updateRootConfig?.(config as MApp); + return; + } + const newNode = app?.dataSourceManager?.compiledNode(config, undefined, true) || config; + replaceChildNode(newNode, [root], parentId); updateConfig(cloneDeep(root)); }, diff --git a/runtime/vue-runtime-help/package.json b/runtime/vue-runtime-help/package.json index 1d8854fa..b4c852c5 100644 --- a/runtime/vue-runtime-help/package.json +++ b/runtime/vue-runtime-help/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.4", + "version": "1.1.5", "name": "@tmagic/vue-runtime-help", "type": "module", "sideEffects": false, diff --git a/runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts b/runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts index 0222f75c..9a892b12 100644 --- a/runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts +++ b/runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts @@ -90,7 +90,13 @@ export const useEditorDsl = (app = inject('app'), win = window) => { update({ config, parentId }: UpdateData) { if (!root.value || !app) throw new Error('error'); + if (config.type === 'app') { + this.updateRootConfig?.(config as MApp); + return; + } + const newNode = app.dataSourceManager?.compiledNode(config, undefined, true) || config; + replaceChildNode(reactive(newNode), [root.value], parentId); const nodeInstance = app.getNode(config.id);