Skip to content

Commit

Permalink
fix(runtime): 更新page后,在编辑器中无法打开蒙层
Browse files Browse the repository at this point in the history
由于更新page后,会去判断app.page.data对象是否为dsl中page的配置,如果不是会销毁page,重新new,就导致overlay中page的监听失效

fix #587
  • Loading branch information
roymondchen committed Apr 16, 2024
1 parent fc1a7a0 commit 69c555f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion runtime/vue2/playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},
Expand Down
6 changes: 5 additions & 1 deletion runtime/vue3/playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},
Expand Down

0 comments on commit 69c555f

Please sign in to comment.