mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-18 03:20:03 +08:00
fix(core): 没有设置curPage,默认取第一个page
This commit is contained in:
parent
74ce204489
commit
44290b65ba
@ -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);
|
||||
@ -177,6 +181,7 @@ class App extends EventEmitter {
|
||||
this.page.destroy();
|
||||
this.page = undefined;
|
||||
}
|
||||
|
||||
super.emit('page-change');
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user