From e78cd4793353b81fbd8a6d5fdae352b9766a4bc1 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 2 Aug 2022 14:37:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=A4=8D=E9=80=89=E6=A1=86=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Toolbar.vue | 4 ++-- frontend/src/store/index.js | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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) {