|
|
@@ -1,47 +1,43 @@
|
|
|
-<script setup lang="ts">
|
|
|
-import HelloWorld from './components/HelloWorld.vue'
|
|
|
-import TheWelcome from './components/TheWelcome.vue'
|
|
|
-</script>
|
|
|
-
|
|
|
<template>
|
|
|
- <header>
|
|
|
- <img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
|
|
|
-
|
|
|
- <div class="wrapper">
|
|
|
- <HelloWorld msg="You did it!" />
|
|
|
+ <div>
|
|
|
+ <div class="nav">
|
|
|
+ <RouterLink active-class="active" to="/home">主页</RouterLink>
|
|
|
+ <RouterLink
|
|
|
+ active-class="active"
|
|
|
+ :to="{
|
|
|
+ path: '/list',
|
|
|
+ }"
|
|
|
+ >列表</RouterLink
|
|
|
+ >
|
|
|
+ <RouterLink
|
|
|
+ active-class="active"
|
|
|
+ :to="{
|
|
|
+ name: 'wode',
|
|
|
+ }"
|
|
|
+ >我的</RouterLink
|
|
|
+ >
|
|
|
</div>
|
|
|
- </header>
|
|
|
-
|
|
|
- <main>
|
|
|
- <TheWelcome />
|
|
|
- </main>
|
|
|
+ <RouterView></RouterView>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
-<style scoped>
|
|
|
-header {
|
|
|
- line-height: 1.5;
|
|
|
-}
|
|
|
-
|
|
|
-.logo {
|
|
|
- display: block;
|
|
|
- margin: 0 auto 2rem;
|
|
|
-}
|
|
|
-
|
|
|
-@media (min-width: 1024px) {
|
|
|
- header {
|
|
|
- display: flex;
|
|
|
- place-items: center;
|
|
|
- padding-right: calc(var(--section-gap) / 2);
|
|
|
- }
|
|
|
-
|
|
|
- .logo {
|
|
|
- margin: 0 2rem 0 0;
|
|
|
- }
|
|
|
+<script lang="ts" setup>
|
|
|
+import { ref, reactive } from "vue";
|
|
|
+import { RouterView, RouterLink } from "vue-router";
|
|
|
+</script>
|
|
|
|
|
|
- header .wrapper {
|
|
|
- display: flex;
|
|
|
- place-items: flex-start;
|
|
|
- flex-wrap: wrap;
|
|
|
+<style lang="scss" scoped>
|
|
|
+.nav {
|
|
|
+ width: 500px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ a {
|
|
|
+ color: #000;
|
|
|
+ font-size: 24px;
|
|
|
+ text-decoration: none;
|
|
|
}
|
|
|
}
|
|
|
+.active {
|
|
|
+ color: #f00 !important;
|
|
|
+}
|
|
|
</style>
|