|
|
@@ -18,8 +18,8 @@
|
|
|
<li class="h-nav-li">
|
|
|
<nuxt-link to="/">首页</nuxt-link>
|
|
|
</li>
|
|
|
- <li>
|
|
|
- <a href="javascript:void(0)">产品与服务</a>
|
|
|
+ <li :class="{'h-nav-li-more': productActive}">
|
|
|
+ <a class="h-nav-list-parent" href="javascript:void(0)">产品与服务</a>
|
|
|
<!-- <nuxt-link to="">产品与服务</nuxt-link> -->
|
|
|
<ul class="h-nav-list-child">
|
|
|
<li>
|
|
|
@@ -46,8 +46,8 @@
|
|
|
<li class="h-nav-li">
|
|
|
<nuxt-link to="/cooperate">加盟合作</nuxt-link>
|
|
|
</li>
|
|
|
- <li>
|
|
|
- <a href="javascript:void(0)">关于我们</a>
|
|
|
+ <li :class="{'h-nav-li-more': aboutActive}">
|
|
|
+ <a class="h-nav-list-parent" href="javascript:void(0)">关于我们</a>
|
|
|
<!-- <nuxt-link to="">关于我们</nuxt-link> -->
|
|
|
<ul class="h-nav-list-child">
|
|
|
<li>
|
|
|
@@ -77,6 +77,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState } from "vuex";
|
|
|
+import { turquoise } from 'color-name';
|
|
|
|
|
|
export default {
|
|
|
name: "VHeader",
|
|
|
@@ -84,17 +85,23 @@ export default {
|
|
|
return {
|
|
|
headFixed: true,
|
|
|
maxClientWidth: 980,
|
|
|
- isShowCode: false,
|
|
|
+ productActive: false,
|
|
|
+ aboutActive: false,
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ $route () {
|
|
|
+ this.handleRouterActive();
|
|
|
+ console.log('route changed', this.$route.fullPath)
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(["headProdNav", "headNewsNav", "headJobNav"]),
|
|
|
},
|
|
|
mounted() {
|
|
|
//监听滚动条
|
|
|
window.addEventListener("scroll", this.handleScroll);
|
|
|
- console.log(this.$route.parmas);
|
|
|
- console.log(this.$route.fullPath);
|
|
|
+ this.handleRouterActive();
|
|
|
},
|
|
|
methods: {
|
|
|
handleScroll() {
|
|
|
@@ -106,9 +113,18 @@ export default {
|
|
|
// this.headFixed = false;
|
|
|
// }
|
|
|
},
|
|
|
- showCode() {
|
|
|
- this.isShowCode = !this.isShowCode;
|
|
|
- },
|
|
|
+ handleRouterActive() {
|
|
|
+ if(this.$route.fullPath && this.$route.fullPath.includes('/about')) {
|
|
|
+ this.aboutActive = true;
|
|
|
+ } else {
|
|
|
+ this.aboutActive = false;
|
|
|
+ }
|
|
|
+ if(this.$route.fullPath && this.$route.fullPath.includes('/product')) {
|
|
|
+ this.productActive = true;
|
|
|
+ } else {
|
|
|
+ this.productActive = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
destroyed() {
|
|
|
window.removeEventListener("scroll", this.handleScroll);
|
|
|
@@ -118,6 +134,16 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import '~static/common/style.sass';
|
|
|
+.h-nav-list {
|
|
|
+ .h-nav-li-more {
|
|
|
+ .h-nav-list-parent {
|
|
|
+ color: $theme_color;
|
|
|
+ }
|
|
|
+ .expand {
|
|
|
+ color: $theme_color;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
.nav-space {
|
|
|
height: 72px;
|