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

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

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

@ -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 {
},
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.dropdown-menu-self {
width: 200px;
margin-top: 0 !important;

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

Loading…
Cancel
Save