fix(core): 设置page时查找原page兼容数字id情况

fix #547
This commit is contained in:
roymondchen 2023-11-06 11:35:44 +08:00
parent 6fda0e6e44
commit 168ec281aa

View File

@ -195,7 +195,7 @@ class App extends EventEmitter implements AppCore {
}
public setPage(id?: Id) {
const pageConfig = this.dsl?.items.find((page) => page.id === id);
const pageConfig = this.dsl?.items.find((page) => `${page.id}` === `${id}`);
if (!pageConfig) {
if (this.page) {
@ -234,7 +234,7 @@ class App extends EventEmitter implements AppCore {
*/
public getPage(id?: Id) {
if (!id) return this.page;
if (this.page?.data.id === id) {
if (this.page && `${this.page.data.id}` === `${id}`) {
return this.page;
}
}