Files
Mainpage/src/App.vue

34 lines
530 B
Vue
Raw Normal View History

2025-03-02 22:11:27 +08:00
<script setup>
</script>
2025-03-01 21:30:49 +08:00
<template>
<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>
/* 全局样式 */
nav {
padding: 10px;
background-color: #f0f0f0;
2025-03-01 21:30:49 +08:00
}
nav a {
margin-right: 10px;
text-decoration: none;
color: #333;
2025-03-01 21:30:49 +08:00
}
nav a.router-link-active {
color: #42b983;
font-weight: bold;
2025-03-01 21:30:49 +08:00
}
</style>