Skip to content

Commit

Permalink
fix(core): 没有设置curPage,默认取第一个page
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Mar 30, 2023
1 parent 74ce204 commit 44290b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ class App extends EventEmitter {
}

if (options.config) {
this.setConfig(options.config, options.curPage);
let pageId = options.curPage;
if (!pageId && options.config.items.length) {
pageId = options.config.items[0].id;
}
this.setConfig(options.config, pageId);
}

bindCommonEventListener(this);
Expand Down Expand Up @@ -177,6 +181,7 @@ class App extends EventEmitter {
this.page.destroy();
this.page = undefined;
}

super.emit('page-change');
return;
}
Expand Down

0 comments on commit 44290b6

Please sign in to comment.