2025-03-02 22:11:27 +08:00
|
|
|
<script setup>
|
|
|
|
</script>
|
|
|
|
|
2025-03-01 21:30:49 +08:00
|
|
|
<template>
|
2025-03-04 11:11:24 +08:00
|
|
|
<div>
|
|
|
|
<!-- 全局导航栏 -->
|
|
|
|
<nav>
|
|
|
|
<router-link to="/">首页</router-link> |
|
|
|
|
<router-link to="/about">关于</router-link>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
<!-- 路由匹配的组件会渲染在这里 -->
|
|
|
|
<router-view />
|
|
|
|
</div>
|
2025-03-01 21:30:49 +08:00
|
|
|
</template>
|
|
|
|
|
2025-03-02 22:11:27 +08:00
|
|
|
<style scoped>
|
2025-03-04 11:11:24 +08:00
|
|
|
/* 全局样式 */
|
|
|
|
nav {
|
|
|
|
padding: 10px;
|
|
|
|
background-color: #f0f0f0;
|
2025-03-01 21:30:49 +08:00
|
|
|
}
|
2025-03-04 11:11:24 +08:00
|
|
|
|
|
|
|
nav a {
|
|
|
|
margin-right: 10px;
|
|
|
|
text-decoration: none;
|
|
|
|
color: #333;
|
2025-03-01 21:30:49 +08:00
|
|
|
}
|
2025-03-04 11:11:24 +08:00
|
|
|
|
|
|
|
nav a.router-link-active {
|
|
|
|
color: #42b983;
|
|
|
|
font-weight: bold;
|
2025-03-01 21:30:49 +08:00
|
|
|
}
|
2025-03-04 11:11:24 +08:00
|
|
|
</style>
|