diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index aad29b1a67..355af8037e 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -208,7 +208,8 @@ export default { methods: { close() { // 关闭页面清理缓存 - this.clearCanvas() + this.$store.commit('initCanvasBase') + this.$store.commit('setInEditorStatus', false) this.$emit('close-left-panel') this.$nextTick(() => { bus.$emit('PanelSwitchComponent', { name: 'PanelMain' }) @@ -373,7 +374,6 @@ export default { clearCanvas() { this.$store.commit('setComponentData', []) this.$store.commit('recordSnapshot', 'clearCanvas') - this.$store.commit('setInEditorStatus', false) }, handlePreviewChange() { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index fc356e5295..f83f7a7acc 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -659,7 +659,7 @@ const data = { setChangeProperties(state, propertyInfo) { state.changeProperties[propertyInfo.custom][propertyInfo.property] = propertyInfo.value }, - initCanvas(state) { + initCanvasBase(state) { this.commit('setCurComponent', { component: null, index: null }) this.commit('clearLinkageSettingInfo', false) this.commit('resetViewEditInfo') @@ -676,6 +676,9 @@ const data = { customStyle: {}, customAttr: {} } + }, + initCanvas(state) { + this.commit('initCanvasBase') state.isInEditor = true }, initViewRender(state, pluginViews) {