diff --git a/packages/editor/src/Editor.vue b/packages/editor/src/Editor.vue index 218a34d9..8e65eeda 100644 --- a/packages/editor/src/Editor.vue +++ b/packages/editor/src/Editor.vue @@ -55,7 +55,7 @@ import eventsService from '@editor/services/events'; import historyService from '@editor/services/history'; import propsService from '@editor/services/props'; import uiService from '@editor/services/ui'; -import type { ComponentGroup, MenuBarData, Services, SideBarData } from '@editor/type'; +import type { ComponentGroup, MenuBarData, Services, SideBarData, StageRect } from '@editor/type'; export default defineComponent({ name: 'm-editor', @@ -133,8 +133,8 @@ export default defineComponent({ type: Function as PropType<(el: HTMLElement) => boolean | Promise>, }, - stageStyle: { - type: [String, Object] as PropType>, + stageRect: { + type: [String, Object] as PropType, }, }, @@ -208,8 +208,8 @@ export default defineComponent({ ); watch( - () => props.stageStyle, - (stageStyle) => uiService.set('stageStyle', stageStyle), + () => props.stageRect, + (stageRect) => stageRect && uiService.set('stageRect', stageRect), { immediate: true, }, diff --git a/packages/editor/src/layouts/workspace/Stage.vue b/packages/editor/src/layouts/workspace/Stage.vue index 0c7a2b53..792c7713 100644 --- a/packages/editor/src/layouts/workspace/Stage.vue +++ b/packages/editor/src/layouts/workspace/Stage.vue @@ -1,5 +1,5 @@