做专业的水下设备制造商 旁站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

75 lines
1.6 KiB

<template>
<div class="header_container">
<img :src="Logo" alt="logo" class="logo_img" @click="toHome()" />
<ul class="tab_group">
<li :class="activeTab == 0 ? 'active' : ''" @click="changeActiveTab(0)">
首页
</li>
<li :class="activeTab == 1 ? 'active' : ''" @click="changeActiveTab(1)">
关于我们
</li>
<li :class="activeTab == 2 ? 'active' : ''" @click="changeActiveTab(2)">
产品中心
</li>
<li :class="activeTab == 3 ? 'active' : ''" @click="changeActiveTab(3)">
联系我们
</li>
</ul>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import Logo from '@/static/img/index/2.png'
const activeTab = ref(0)
const router = useRouter()
const changeActiveTab = index => {
activeTab.value = index
if (index == 2) {
router.push('/product')
}
if (index == 0) {
toHome()
}
}
const toHome = () => {
router.push('/')
}
</script>
<style lang="scss" scoped>
.header_container {
padding: 23px 200px;
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
top: 0;
left: 0;
right: 0;
.logo_img {
width: 216px;
height: 44px;
cursor: pointer;
}
.tab_group {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 18px;
font-weight: 200;
color: #ffffff;
& > li {
margin-right: 65px;
cursor: pointer;
&:last-child {
margin-right: 0;
}
}
.active {
font-weight: 500;
}
}
}
</style>