mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-11-06 11:58:02 +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) {
|
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);
|
bindCommonEventListener(this);
|
||||||
@ -177,6 +181,7 @@ class App extends EventEmitter {
|
|||||||
this.page.destroy();
|
this.page.destroy();
|
||||||
this.page = undefined;
|
this.page = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.emit('page-change');
|
super.emit('page-change');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user