From bc9d81c301f779cd7a8bcb55eb096c494ab6c9ff Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 20 Sep 2022 17:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index a540ee62f..a3053f9a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -89,13 +89,15 @@ export default { } }); window.addEventListener('storage', e => { - if (e.key == 'setTrainingOperate') { - const operate = JSON.parse(e.newValue); - this.$store.dispatch('trainingNew/setTrainingOperate', operate); - } - if (e.key == 'setSceneOperate') { - const operate = JSON.parse(e.newValue); - this.$store.dispatch('trainingNew/setSceneOperate', operate); + if (this.$route.path.includes('trainingDesign')) { + if (e.key == 'setTrainingOperate') { + const operate = JSON.parse(e.newValue); + this.$store.dispatch('trainingNew/setTrainingOperate', operate); + } + if (e.key == 'setSceneOperate') { + const operate = JSON.parse(e.newValue); + this.$store.dispatch('trainingNew/setSceneOperate', operate); + } } }); this.$nextTick(() => {