From 6aa3e4992ecde6cdfc775ff76832205b53063f17 Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Tue, 10 May 2022 20:00:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E5=A4=B4=E9=83=A8=E5=BA=95=E9=83=A8=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/default.vue | 22 +++++++++++----------- layouts/module/header/HeaderInfoBar.vue | 4 ++-- layouts/module/header/index.vue | 12 ++++++++++++ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/layouts/default.vue b/layouts/default.vue index 2d08f98..26e8b66 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -9,8 +9,9 @@
@@ -21,8 +22,7 @@ import BsLogin from "@/components/BsLogin.vue"; import Header from "./module/header/index.vue"; import Footer from "./module/footer/index.vue"; -const CATEGROY_OPEN_PAGES = ["/"]; // 默认展开热门分类tab的页面 -const CATEGROY_HIDE_PAGES = ["/account"]; // 不展示热门分类tab的页面 +const CATEGROY_HIDE_PAGES = [/\/account/]; // 隐藏热门分类tab的页面 export default { name: "Layout", @@ -42,13 +42,13 @@ export default { this.$store.commit("setLoginVisible", val); }, }, - categroyOption() { - // 当前页面路径 - const currentPath = this.$route.path; - return { - open: CATEGROY_OPEN_PAGES.includes(currentPath), - show: !CATEGROY_HIDE_PAGES.includes(currentPath), - }; + isHomePage() { + return this.$route.path === "/"; + }, + showCategroyTab() { + return !CATEGROY_HIDE_PAGES.some((reg) => { + return reg.test(this.$route.path); + }); }, }, mounted() { diff --git a/layouts/module/header/HeaderInfoBar.vue b/layouts/module/header/HeaderInfoBar.vue index a97ff74..0a7fc93 100644 --- a/layouts/module/header/HeaderInfoBar.vue +++ b/layouts/module/header/HeaderInfoBar.vue @@ -116,7 +116,7 @@ export default { handleCommandClick(event) { switch (event) { case MENU_VALUE.PERSONAL: - this.$router.push("/account/userInfo"); + this.$router.push("/account/home"); break; case MENU_VALUE.ADDRESS: this.$router.push("/account/address"); @@ -136,7 +136,7 @@ export default { }, }; -