nuxt初始化
This commit is contained in:
42
nuxt-web/components/company/CompanySectionNav.vue
Normal file
42
nuxt-web/components/company/CompanySectionNav.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { companySectionLinks } from '~/data/company'
|
||||
|
||||
const route = useRoute()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<nav class="company-nav" aria-label="公司栏目导航">
|
||||
<NuxtLink
|
||||
v-for="item in companySectionLinks"
|
||||
:key="item.to"
|
||||
:to="item.to"
|
||||
:class="['company-nav__link', { active: route.path === item.to }]"
|
||||
>
|
||||
{{ item.label }}
|
||||
</NuxtLink>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.company-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px 16px;
|
||||
}
|
||||
|
||||
.company-nav__link {
|
||||
padding: 8px 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid #c6d6e7;
|
||||
background: #fff;
|
||||
color: #102541;
|
||||
}
|
||||
|
||||
.company-nav__link.active {
|
||||
background: #102541;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user