|
@@ -1,85 +1,92 @@
|
|
|
<script setup lang="ts">
|
|
|
import { RouterLink, RouterView } from 'vue-router'
|
|
|
-import HelloWorld from './components/HelloWorld.vue'
|
|
|
+import AppleBar from "@/components/layout/appleBar.vue";
|
|
|
+import type {navItem} from '@/types/appleBar';
|
|
|
+
|
|
|
+let navItems:navItem[] = [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: '首页',
|
|
|
+ actionCode: 'toHome',
|
|
|
+ description: '返回首页',
|
|
|
+ icon: 'icon-home',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: '首页',
|
|
|
+ actionCode: 'toHome',
|
|
|
+ description: '返回首页',
|
|
|
+ icon: 'icon-home',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: '首页',
|
|
|
+ actionCode: 'toHome',
|
|
|
+ description: '返回首页',
|
|
|
+ icon: 'icon-home',
|
|
|
+ },
|
|
|
+]
|
|
|
</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!" />
|
|
|
-
|
|
|
- <nav>
|
|
|
- <RouterLink to="/">Home</RouterLink>
|
|
|
- <RouterLink to="/about">About</RouterLink>
|
|
|
- </nav>
|
|
|
+<!-- -->
|
|
|
+ <div class="app-container">
|
|
|
+ <div class="app-bar">
|
|
|
+ <!-- 模仿苹果导航条 -->
|
|
|
+ <apple-bar
|
|
|
+ :nav-items="navItems"
|
|
|
+ :hide-time="5000"
|
|
|
+ ></apple-bar>
|
|
|
+ </div>
|
|
|
+ <div class="app-content">
|
|
|
+ <RouterView />
|
|
|
</div>
|
|
|
- </header>
|
|
|
|
|
|
- <RouterView />
|
|
|
+ </div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<style scoped>
|
|
|
-header {
|
|
|
- line-height: 1.5;
|
|
|
- max-height: 100vh;
|
|
|
-}
|
|
|
-
|
|
|
-.logo {
|
|
|
- display: block;
|
|
|
- margin: 0 auto 2rem;
|
|
|
-}
|
|
|
-
|
|
|
-nav {
|
|
|
+.app-container {
|
|
|
width: 100%;
|
|
|
- font-size: 12px;
|
|
|
- text-align: center;
|
|
|
- margin-top: 2rem;
|
|
|
-}
|
|
|
-
|
|
|
-nav a.router-link-exact-active {
|
|
|
- color: var(--color-text);
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow: hidden;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
|
|
|
-nav a.router-link-exact-active:hover {
|
|
|
- background-color: transparent;
|
|
|
-}
|
|
|
-
|
|
|
-nav a {
|
|
|
- display: inline-block;
|
|
|
- padding: 0 1rem;
|
|
|
- border-left: 1px solid var(--color-border);
|
|
|
+.app-content {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: var(--color-background-soft);
|
|
|
+ overflow: auto;
|
|
|
+ background-image: url("@/assets/images/bg.jpg");
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100%;
|
|
|
+ background-position: center;
|
|
|
}
|
|
|
|
|
|
-nav a:first-of-type {
|
|
|
- border: 0;
|
|
|
+.app-bar{
|
|
|
+ width: 100%;
|
|
|
+ height: 70px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ bottom: 0;
|
|
|
}
|
|
|
|
|
|
-@media (min-width: 1024px) {
|
|
|
- header {
|
|
|
- display: flex;
|
|
|
- place-items: center;
|
|
|
- padding-right: calc(var(--section-gap) / 2);
|
|
|
- }
|
|
|
|
|
|
- .logo {
|
|
|
- margin: 0 2rem 0 0;
|
|
|
+@media screen and (max-width: 768px) {
|
|
|
+ .app-content {
|
|
|
+ height: calc(100% - 50px);
|
|
|
}
|
|
|
-
|
|
|
- header .wrapper {
|
|
|
- display: flex;
|
|
|
- place-items: flex-start;
|
|
|
- flex-wrap: wrap;
|
|
|
+ .app-bar {
|
|
|
+ position: relative;
|
|
|
+ bottom: 0;
|
|
|
}
|
|
|
|
|
|
- nav {
|
|
|
- text-align: left;
|
|
|
- margin-left: -1rem;
|
|
|
- font-size: 1rem;
|
|
|
-
|
|
|
- padding: 1rem 0;
|
|
|
- margin-top: 1rem;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|