Skip to content

Commit 6677882

Browse files
committed
feat: add layouts
1 parent 1940b2a commit 6677882

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

layouts/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Layouts
2+
3+
Vue components in this dir are used as layouts.
4+
5+
By default, `default.vue` will be used unless an alternative is specified in the route meta.
6+
7+
```vue
8+
<script setup lang="ts">
9+
definePageMeta({
10+
layout: 'home',
11+
})
12+
</script>
13+
```
14+
15+
Learn more on <https://nuxt.com/docs/guide/directory-structure/layouts>

layouts/default.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<main class="px-10 py-20">
3+
<slot />
4+
5+
<div class="mx-auto mt-5 text-center opacity-25">
6+
[Default Layout]
7+
</div>
8+
</main>
9+
</template>

layouts/home.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<main class="px-10 py-20">
3+
<slot />
4+
5+
<div class="mx-auto mt-5 text-center opacity-25">
6+
[Home Layout]
7+
</div>
8+
</main>
9+
</template>

0 commit comments

Comments
 (0)