mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-11 14:45:10 +08:00
fix(editor): 页面切换不在重新渲染画布
This commit is contained in:
parent
239b5d3efe
commit
b7934f9f51
@ -27,7 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="MEditorStage">
|
||||
import { computed, inject, markRaw, onMounted, onUnmounted, ref, toRaw, watch, watchEffect } from 'vue';
|
||||
import { computed, inject, markRaw, nextTick, onMounted, onUnmounted, ref, toRaw, watch, watchEffect } from 'vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
import type { MApp, MContainer, MNode, MPage } from '@tmagic/schema';
|
||||
@ -96,6 +96,15 @@ watch(root, (root) => {
|
||||
}
|
||||
});
|
||||
|
||||
watch(page, (page) => {
|
||||
if (runtime && page) {
|
||||
runtime.updatePageId?.(page.id);
|
||||
nextTick(() => {
|
||||
stage?.select(page.id);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const resizeObserver = new ResizeObserver((entries) => {
|
||||
for (const { contentRect } of entries) {
|
||||
services?.uiService.set('stageContainerRect', {
|
||||
|
@ -3,7 +3,7 @@
|
||||
<Breadcrumb></Breadcrumb>
|
||||
|
||||
<slot name="stage">
|
||||
<MagicStage :key="page?.id" :stage-content-menu="stageContentMenu"></MagicStage>
|
||||
<MagicStage v-if="page" :stage-content-menu="stageContentMenu"></MagicStage>
|
||||
</slot>
|
||||
|
||||
<slot name="workspace-content"></slot>
|
||||
|
Loading…
x
Reference in New Issue
Block a user