|
|
|
@ -9,8 +9,9 @@
|
|
|
|
|
<div class="layout">
|
|
|
|
|
<BsLogin :visible.sync="loginVisible" />
|
|
|
|
|
<Header
|
|
|
|
|
:is-categroy-open="categroyOption.open"
|
|
|
|
|
:show-categroy-tab="categroyOption.show"
|
|
|
|
|
:is-categroy-open="isHomePage"
|
|
|
|
|
:hide-bar-line="isHomePage"
|
|
|
|
|
:show-categroy-tab="showCategroyTab"
|
|
|
|
|
:is-sticky="isSticky"
|
|
|
|
|
/>
|
|
|
|
|
<Nuxt />
|
|
|
|
@ -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() {
|
|
|
|
|