-
Notifications
You must be signed in to change notification settings - Fork 253
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
24 changed files
with
198 additions
and
83 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<template> | ||
<main class="h-full w-full p-16 py-60"> | ||
<div class="p-16 py-60"> | ||
<slot /> | ||
</main> | ||
</div> | ||
</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,21 @@ | ||
<script setup lang="ts"> | ||
const router = useRouter() | ||
</script> | ||
|
||
<template> | ||
<main p="x4 y16" text-18 text="center gray-300 dark:gray-200"> | ||
<van-icon name="warn-o" size="3em" /> | ||
|
||
<RouterView /> | ||
|
||
<div class="mt-10"> | ||
<button van-haptics-feedback btn m="3 t8" @click="router.back()"> | ||
Back | ||
</button> | ||
</div> | ||
</main> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Layouts | ||
|
||
Vue components in this dir are used as layouts. | ||
|
||
By default, `default.vue` will be used unless an alternative is specified in the route meta. | ||
|
||
With [`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router) and [`vite-plugin-vue-layouts`](https://github.com/JohnCampionJr/vite-plugin-vue-layouts), you can specify the layout in the page's SFCs like this: | ||
|
||
```vue | ||
<route lang="yaml"> | ||
meta: | ||
layout: home | ||
</route> | ||
``` |
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,9 @@ | ||
<template> | ||
<main text="gray-700 dark:gray-200"> | ||
<RouterView /> | ||
|
||
<div mx-auto mt-15 text-center text-14 opacity-50> | ||
Default Layout | ||
</div> | ||
</main> | ||
</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,9 @@ | ||
<template> | ||
<main py-20 text="gray-700 dark:gray-200"> | ||
<RouterView /> | ||
|
||
<div mx-auto mt-15 text-center text-14 opacity-50> | ||
Home Layout | ||
</div> | ||
</main> | ||
</template> |
File renamed without changes.
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,10 @@ | ||
<template> | ||
<div> | ||
Not found | ||
</div> | ||
</template> | ||
|
||
<route lang="yaml"> | ||
meta: | ||
layout: 404 | ||
</route> |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script setup lang="ts"> | ||
import useAppStore from '@/stores/modules/app' | ||
definePage({ | ||
name: 'main', | ||
meta: { | ||
level: 1, | ||
}, | ||
}) | ||
const appStore = useAppStore() | ||
const checked = ref<boolean>(isDark.value) | ||
watch( | ||
() => isDark.value, | ||
(newMode) => { | ||
checked.value = newMode | ||
}, | ||
{ immediate: true }, | ||
) | ||
function toggle() { | ||
toggleDark() | ||
appStore.swithMode(isDark.value ? 'dark' : 'light') | ||
} | ||
</script> | ||
|
||
<template> | ||
<VanCellGroup inset> | ||
<VanCell center title="🌗 暗黑模式"> | ||
<template #right-icon> | ||
<VanSwitch v-model="checked" size="20px" @click="toggle()" /> | ||
</template> | ||
</VanCell> | ||
|
||
<VanCell title="💿 Mock 指南" to="mock" is-link /> | ||
<VanCell title="📊 Echarts 演示" to="charts" is-link /> | ||
<VanCell title="🎨 Unocss 示例" to="unocss" is-link /> | ||
<VanCell title="🍍 持久化 Pinia 状态" to="counter" is-link /> | ||
<VanCell title="🙅 404 演示" to="unknown" is-link /> | ||
|
||
<VanCell center> | ||
<template #title> | ||
<span class="mr-4 v-middle">🚀 欢迎补充</span> | ||
<VanTag type="primary"> | ||
PR | ||
</VanTag> | ||
</template> | ||
</VanCell> | ||
</VanCellGroup> | ||
</template> | ||
|
||
<route lang="yaml"> | ||
meta: | ||
layout: home | ||
</route> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# `File-based Routing` | ||
|
||
Routes will be auto-generated for Vue files in the **src/views** dir with the same file structure. | ||
Routes will be auto-generated for Vue files in the **src/pages** dir with the same file structure. | ||
Check out [`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router) for more details. | ||
|
||
在 **src/views** 目录下的 Vue 文件会自动生成相同结构的路由。 | ||
在 **src/pages** 目录下的 Vue 文件会自动生成相同结构的路由。 | ||
|
||
查看[`unplugin-vue-router`](https://github.com/posva/unplugin-vue-router)了解更多细节。 |
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
Oops, something went wrong.