From 9dc0d30a9ca814d76efe6f8c77edd844fb656ab0 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Sat, 5 Jun 2021 22:15:10 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=BB=84=E7=BB=87=E5=92=8C=E5=B7=A5=E4=BD=9C=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/App.vue | 15 +++++++++++---- .../components/common/head/HeaderOrgWs.vue | 7 +++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/App.vue b/frontend/src/business/App.vue index 6d0d0fbbd4..274b3ac052 100644 --- a/frontend/src/business/App.vue +++ b/frontend/src/business/App.vue @@ -5,7 +5,7 @@ - + @@ -53,6 +53,7 @@ export default { color: '', sessionTimer: null, isShow: true, + isMenuShow: true, }; }, created() { @@ -106,7 +107,8 @@ export default { // 提供可注入子组件属性 provide() { return { - reload: this.reload + reload: this.reload, + reloadTopMenus: this.reloadTopMenus, } }, methods: { @@ -147,11 +149,16 @@ export default { reload() { // 先隐藏 this.isShow = false - - // $nextTick() 将回调延迟到下次 DOM 更新循环之后执行 this.$nextTick(() => { this.isShow = true }) + }, + reloadTopMenus() { + // 先隐藏 + this.isMenuShow = false + this.$nextTick(() => { + this.isMenuShow = true + }) } }, components: { diff --git a/frontend/src/business/components/common/head/HeaderOrgWs.vue b/frontend/src/business/components/common/head/HeaderOrgWs.vue index e55b6aff76..cd8d35c8c9 100644 --- a/frontend/src/business/components/common/head/HeaderOrgWs.vue +++ b/frontend/src/business/components/common/head/HeaderOrgWs.vue @@ -70,6 +70,9 @@ export default { this.initMenuData(); this.getCurrentUserInfo(); }, + inject: [ + 'reloadTopMenus' + ], data() { return { organizationList: [ @@ -154,7 +157,7 @@ export default { // localStorage.removeItem(PROJECT_ID); // } this.$router.push('/').then(() => { - window.location.reload(); + this.reloadTopMenus(); }).catch(err => err); }); }, @@ -172,7 +175,7 @@ export default { // localStorage.removeItem(PROJECT_ID); // } this.$router.push('/').then(() => { - window.location.reload(); + this.reloadTopMenus(); }).catch(err => err); }); },