Skip to content

Commit

Permalink
fix(vue-runtime-help): 更新dsl时,设置默认选中项与默认页面
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Nov 28, 2024
1 parent 383b9c9 commit a38a0a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/vue-runtime-help/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.4",
"version": "0.1.5",
"name": "@tmagic/vue-runtime-help",
"type": "module",
"sideEffects": false,
Expand Down
9 changes: 9 additions & 0 deletions runtime/vue-runtime-help/src/hooks/use-editor-dsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand Down

0 comments on commit a38a0a2

Please sign in to comment.