init: basic structure
This commit is contained in:
17
src/layouts/404.vue
Normal file
17
src/layouts/404.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
const router = useRouter()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main p="x4 y10" text="center green-700 dark:gray-200">
|
||||
<div text-4xl>
|
||||
<div i-ri-error-warning-line inline-block />
|
||||
</div>
|
||||
<RouterView />
|
||||
<div>
|
||||
<button btn text-sm m="3 t8" @click="router.back()">
|
||||
返回
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
14
src/layouts/README.md
Normal file
14
src/layouts/README.md
Normal file
@@ -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 [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages) 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:
|
||||
|
||||
```html
|
||||
<route lang="yaml">
|
||||
meta:
|
||||
layout: home
|
||||
</route>
|
||||
```
|
||||
7
src/layouts/default.vue
Normal file
7
src/layouts/default.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<main class="px-4 text-center text-gray-700 dark:text-gray-200">
|
||||
<Menu />
|
||||
<RouterView />
|
||||
<BaseFooter />
|
||||
</main>
|
||||
</template>
|
||||
Reference in New Issue
Block a user