fix(runtime): 更新page后,在编辑器中无法打开蒙层

由于更新page后,会去判断app.page.data对象是否为dsl中page的配置,如果不是会销毁page,重新new,就导致overlay中page的监听失效

fix #587
This commit is contained in:
roymondchen 2024-04-16 16:28:22 +08:00
parent fc1a7a09ff
commit 69c555f567
2 changed files with 10 additions and 2 deletions

View File

@ -93,7 +93,11 @@ export default defineComponent({
const nodeInstance = app.page?.getNode(config.id);
if (nodeInstance) {
nodeInstance.setData(config);
nodeInstance.setData(newNode);
}
if (app.page?.data.id === config.id) {
app.page.setData(newNode);
}
},

View File

@ -90,7 +90,11 @@ window.magic?.onRuntimeReady({
const nodeInstance = app.page?.getNode(config.id);
if (nodeInstance) {
nodeInstance.setData(config);
nodeInstance.setData(newNode);
}
if (app.page?.data.id === config.id) {
app.page.setData(newNode);
}
},