|
@@ -15,7 +15,7 @@
|
|
|
<nuxt-link to="/" target="_blank">{{L['首页']}}</nuxt-link>
|
|
|
</li>
|
|
|
<li v-for="(item, index) in navList.data" :key="index">
|
|
|
- <a href="javascript:void(0)" @click="navClick(item)">{{
|
|
|
+ <a @click="(e) => navClick(e, item)" :class="{'active': getActive(item)}">{{
|
|
|
item.navName
|
|
|
}}</a>
|
|
|
</li>
|
|
@@ -40,6 +40,8 @@ const showMenu = () => {
|
|
|
showTopMenu.value = true
|
|
|
}
|
|
|
|
|
|
+const routePath = computed(() => route.fullPath);
|
|
|
+
|
|
|
const hideMenu = () => {
|
|
|
setTimeout(() => {
|
|
|
showTopMenu.value = false
|
|
@@ -61,7 +63,13 @@ const getNavData = async () => {
|
|
|
};
|
|
|
getNavData();
|
|
|
|
|
|
-const navClick = (val) => {
|
|
|
+const getActive = (item) => {
|
|
|
+ item = JSON.parse(item.data.replace(/"/g, '"'));
|
|
|
+ return item.link_type === 'url' && routePath.value === quillEscapeToHtml(item.link_value)
|
|
|
+}
|
|
|
+
|
|
|
+const navClick = (e, val) => {
|
|
|
+ e.preventDefault()
|
|
|
val = JSON.parse(val.data.replace(/"/g, '"'));
|
|
|
if (val.link_type == "url") {
|
|
|
//跳转链接地址
|
|
@@ -158,6 +166,7 @@ onMounted(() => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
width: 100%;
|
|
|
+ background-color: #F6F8FA;
|
|
|
}
|
|
|
.header {
|
|
|
width: 1210px;
|
|
@@ -180,7 +189,7 @@ onMounted(() => {
|
|
|
box-sizing: border-box;
|
|
|
z-index:888;
|
|
|
a{
|
|
|
- font-weight: bold;
|
|
|
+ // font-weight: bold;
|
|
|
font-size: $fontE;
|
|
|
color: #282E30;
|
|
|
width: 100%;
|
|
@@ -223,17 +232,23 @@ onMounted(() => {
|
|
|
display: inline-block;
|
|
|
-webkit-box-sizing: border-box;
|
|
|
box-sizing: border-box;
|
|
|
- font-weight: bold;
|
|
|
+ // font-weight: bold;
|
|
|
font-size: $fontE;
|
|
|
color: #282E30;
|
|
|
margin: 0 0 0 15px;
|
|
|
line-height: 45px;
|
|
|
- padding: 0 3px;
|
|
|
+ padding: 0 5px;
|
|
|
width: max-content;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ background-color: $colorMain;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
a:hover {
|
|
|
- color: $colorMain;
|
|
|
+ // color: $colorMain;
|
|
|
border-bottom: 3px solid $colorMain;
|
|
|
}
|
|
|
}
|