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.

89 lines
2.8 KiB

3 years ago
<template>
<div class="header">
<div class="logo">
<img src="/images/logo.png" />
南京生态环境评估决策平台
</div>
<div class="nav">
<div class="nav-item" @click="onNavClick('MicrowaveRadiation')" :class="{'active': currentPath === 'MicrowaveRadiation'}">微波辐射计</div>
<div class="nav-item" @click="onNavClick('RamanLidar')" :class="{'active': currentPath === 'RamanLidar'}">拉曼激光雷达</div>
<div class="nav-item" @click="onNavClick('SynergyEvaluation')" :class="{'active': currentPath === 'SynergyEvaluation'}">生态环境效应评估</div>
<div class="nav-item" @click="onNavClick('DecisionSupport')" :class="{'active': currentPath === 'DecisionSupport'}">决策支持</div>
<div class="nav-item" @click="onNavClick('SystemManagement')" :class="{'active': currentPath === 'SystemManagement'}">系统管理</div>
</div>
</div>
</template>
<script lang="ts">
import { reactive, onMounted, toRefs } from "vue";
import { useRouter } from 'vue-router';
export default {
name: 'Header',
setup() {
const router = useRouter();
let options = reactive({
currentPath: 'MicrowaveRadiation'
})
const onNavClick = (path) => {
options.currentPath = path;
router.push({path: path});
}
return {
...toRefs(options),
onNavClick
}
}
}
</script>
<style lang="less" scoped>
.header {
width: 100%;
3 years ago
height: 0.84rem;
3 years ago
display: flex;
align-items: center;
color: #ffffff;
.logo {
3 years ago
margin-left: 0.2rem;
3 years ago
display: flex;
align-items: center;
letter-spacing: 2px;
3 years ago
font-size: 0.3rem;
3 years ago
font-weight: bold;
img {
3 years ago
width: 0.53rem;
margin-right: 0.1rem;
3 years ago
}
}
.nav {
3 years ago
margin: 0.17rem 0 0 0.5rem;
3 years ago
display: flex;
3 years ago
font-size: 0.22rem;
3 years ago
.nav-item {
3 years ago
width: 1.7rem;
height: 0.66rem;
margin: 0 0.25rem;
line-height: 0.5rem;
3 years ago
text-align: center;
cursor: pointer;
&:nth-of-type(3) {
3 years ago
width: 2.3rem;
3 years ago
&.active {
background: url("/images/nav-bg-big.png") no-repeat center/cover;
}
}
&.active {
color: #ffffff;
background: url("/images/nav-bg.png") no-repeat center/cover;
}
}
}
}
</style>