From a38a0a2f4ee85ffe700048ef48c50c461c5375a1 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 28 Nov 2024 15:13:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(vue-runtime-help):=20=E6=9B=B4=E6=96=B0dsl?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E9=A1=B9=E4=B8=8E=E9=BB=98=E8=AE=A4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/vue-runtime-help/package.json | 2 +- runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/vue-runtime-help/package.json b/runtime/vue-runtime-help/package.json index 29a248bb..67fea990 100644 --- a/runtime/vue-runtime-help/package.json +++ b/runtime/vue-runtime-help/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.4", + "version": "0.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 32a0a596..e0dd99eb 100644 --- a/runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts +++ b/runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts @@ -33,6 +33,15 @@ export const useEditorDsl = (app: TMagicApp | undefined, win = window) => { updateRootConfig(config: MApp) { root.value = config; + + if (typeof curPageId.value === 'undefined') { + curPageId.value = config.items?.[0]?.id; + } + + if (typeof selectedId.value === 'undefined') { + selectedId.value = curPageId.value; + } + app?.setConfig(config, curPageId.value); },