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); },