-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<script setup lang="ts"> | ||
import Layout from "@/layout/index.vue" | ||
</script> | ||
|
||
<template> | ||
<router-view /> | ||
<Layout /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script setup lang="ts"> | ||
const route = useRoute() | ||
const title = computed(() => route.meta.title) | ||
const showLeftArrow = computed(() => route.meta.layout?.navBar?.showLeftArrow) | ||
function onClickLeft() { | ||
history.back() | ||
} | ||
</script> | ||
|
||
<template> | ||
<van-nav-bar | ||
:title="title" | ||
:left-arrow="showLeftArrow" | ||
@click-left="onClickLeft" | ||
safe-area-inset-top placeholder fixed | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script setup lang="ts"> | ||
const router = useRouter() | ||
const tabbarItemList = computed(() => { | ||
const routes = router.getRoutes() | ||
return routes.filter(route => route.meta.layout?.tabbar?.showTabbar).map(route => ({ | ||
title: route.meta.title, | ||
icon: route.meta.layout?.tabbar?.icon, | ||
path: route.path | ||
})) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<van-tabbar placeholder route safe-area-inset-bottom fixed> | ||
<van-tabbar-item | ||
v-for="item in tabbarItemList" | ||
:key="item.path" | ||
:icon="item.icon" | ||
:to="item.path" | ||
replace | ||
> | ||
{{ item.title }} | ||
</van-tabbar-item> | ||
</van-tabbar> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script setup lang="ts"> | ||
import NavBar from "./components/NavBar.vue" | ||
import Tabbar from "./components/Tabbar.vue" | ||
const route = useRoute() | ||
const showNavBar = computed(() => route.meta.layout?.navBar?.showNavBar) | ||
const showTabbar = computed(() => route.meta.layout?.tabbar?.showTabbar) | ||
</script> | ||
|
||
<template> | ||
<NavBar v-if="showNavBar" /> | ||
<router-view overflow-y-auto /> | ||
<Tabbar v-if="showTabbar" /> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters