|
|
@ -9,8 +9,9 @@
|
|
|
|
<div class="layout">
|
|
|
|
<div class="layout">
|
|
|
|
<BsLogin :visible.sync="loginVisible" />
|
|
|
|
<BsLogin :visible.sync="loginVisible" />
|
|
|
|
<Header
|
|
|
|
<Header
|
|
|
|
:is-categroy-open="categroyOption.open"
|
|
|
|
:is-categroy-open="isHomePage"
|
|
|
|
:show-categroy-tab="categroyOption.show"
|
|
|
|
:hide-bar-line="isHomePage"
|
|
|
|
|
|
|
|
:show-categroy-tab="showCategroyTab"
|
|
|
|
:is-sticky="isSticky"
|
|
|
|
:is-sticky="isSticky"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Nuxt />
|
|
|
|
<Nuxt />
|
|
|
@ -21,8 +22,7 @@
|
|
|
|
import BsLogin from "@/components/BsLogin.vue";
|
|
|
|
import BsLogin from "@/components/BsLogin.vue";
|
|
|
|
import Header from "./module/header/index.vue";
|
|
|
|
import Header from "./module/header/index.vue";
|
|
|
|
import Footer from "./module/footer/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 {
|
|
|
|
export default {
|
|
|
|
name: "Layout",
|
|
|
|
name: "Layout",
|
|
|
@ -42,13 +42,13 @@ export default {
|
|
|
|
this.$store.commit("setLoginVisible", val);
|
|
|
|
this.$store.commit("setLoginVisible", val);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
categroyOption() {
|
|
|
|
isHomePage() {
|
|
|
|
// 当前页面路径
|
|
|
|
return this.$route.path === "/";
|
|
|
|
const currentPath = this.$route.path;
|
|
|
|
},
|
|
|
|
return {
|
|
|
|
showCategroyTab() {
|
|
|
|
open: CATEGROY_OPEN_PAGES.includes(currentPath),
|
|
|
|
return !CATEGROY_HIDE_PAGES.some((reg) => {
|
|
|
|
show: !CATEGROY_HIDE_PAGES.includes(currentPath),
|
|
|
|
return reg.test(this.$route.path);
|
|
|
|
};
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|