From b6b0fdc88fdaeb412cbbce03a3bea8a22fb703f4 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 22 Jul 2024 14:59:09 +0800 Subject: [PATCH] fix --- src/layouts/navbar/index.vue | 4 ++-- src/mixins/page/index.js | 9 +++++++++ src/pages/contactUs/index.vue | 4 ++-- src/pages/devHistory/index.vue | 6 ------ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index a7bec39..9730fce 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -53,12 +53,13 @@ export default { }, watch: { '$route' () { - const { siteId } = this.$route.query + const { siteId, id } = this.$route.query // siteId有变化,则重新获取栏目,并更改store if (siteId && (siteId != this.site || this.lastSite != this.site)) { this.getColumn() this.setSite(siteId) } + if (id) this.active = id this.lastSite = siteId this.handleColor() }, @@ -150,7 +151,6 @@ export default { // 跳转 jump (id) { id = id || this.otherMenus[0].id - this.active = id this.getPath(this.otherMenus, id) this.getPath(this.menus, id) this.columnTo(this.toItem) diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index 1dc0b9b..f2ade05 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -14,6 +14,15 @@ export default { return this.$route.query.siteId || this.$store.state.content.site } }, + watch: { + '$route.query' () { + const { id } = this.$route.query + if (id) { + this.id = id + this.getInfo() + } + } + }, mounted () { this.getInfo && this.id && this.getColumnInfo() }, diff --git a/src/pages/contactUs/index.vue b/src/pages/contactUs/index.vue index c3a8104..9bbe6f9 100644 --- a/src/pages/contactUs/index.vue +++ b/src/pages/contactUs/index.vue @@ -18,8 +18,8 @@ - - + +