diff --git a/README.md b/README.md index e7c64a9..bc8a3f5 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ - 🍍 [State Management via Pinia](https://pinia.vuejs.org) +- 📑 [Layout system](./src/layouts) + - 🎨 [UnoCSS](https://github.com/antfu/unocss) - the instant on-demand atomic CSS engine - 🔥 Use the [new ` + + + + diff --git a/src/layouts/README.md b/src/layouts/README.md new file mode 100644 index 0000000..fb3135f --- /dev/null +++ b/src/layouts/README.md @@ -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 + +meta: + layout: home + +``` diff --git a/src/layouts/default.vue b/src/layouts/default.vue new file mode 100644 index 0000000..55c4bff --- /dev/null +++ b/src/layouts/default.vue @@ -0,0 +1,9 @@ + diff --git a/src/layouts/home.vue b/src/layouts/home.vue new file mode 100644 index 0000000..93b152b --- /dev/null +++ b/src/layouts/home.vue @@ -0,0 +1,9 @@ + diff --git a/src/views/README.md b/src/pages/README.md similarity index 100% rename from src/views/README.md rename to src/pages/README.md diff --git a/src/pages/[...all].vue b/src/pages/[...all].vue new file mode 100644 index 0000000..369e3a9 --- /dev/null +++ b/src/pages/[...all].vue @@ -0,0 +1,10 @@ + + + +meta: + layout: 404 + diff --git a/src/views/charts/index.vue b/src/pages/charts/index.vue similarity index 100% rename from src/views/charts/index.vue rename to src/pages/charts/index.vue diff --git a/src/views/counter/index.vue b/src/pages/counter/index.vue similarity index 91% rename from src/views/counter/index.vue rename to src/pages/counter/index.vue index 677112f..04e58d4 100644 --- a/src/views/counter/index.vue +++ b/src/pages/counter/index.vue @@ -21,7 +21,7 @@ const onClickLeft = () => history.back()