feat: 添加公共头部底部边框

merge-requests/14/head
xiaoguang 2 years ago
parent 936db76a1f
commit 6aa3e4992e

@ -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() {

@ -116,7 +116,7 @@ export default {
handleCommandClick(event) { handleCommandClick(event) {
switch (event) { switch (event) {
case MENU_VALUE.PERSONAL: case MENU_VALUE.PERSONAL:
this.$router.push("/account/userInfo"); this.$router.push("/account/home");
break; break;
case MENU_VALUE.ADDRESS: case MENU_VALUE.ADDRESS:
this.$router.push("/account/address"); this.$router.push("/account/address");
@ -136,7 +136,7 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.dropdown-menu-self { .dropdown-menu-self {
width: 200px; width: 200px;
margin-top: 0 !important; margin-top: 0 !important;

@ -135,6 +135,7 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="!hideBarLine" class="layout-header-line"></div>
</template> </template>
</div> </div>
</template> </template>
@ -167,6 +168,12 @@ export default {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
//
hideBarLine: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
@ -475,4 +482,9 @@ export default {
} }
} }
} }
.layout-header-line {
width: 100%;
height: 2px;
background: #ff875b;
}
</style> </style>

Loading…
Cancel
Save