diff --git a/examples/showcase/layouts/custom.vue b/examples/showcase/layouts/custom.vue new file mode 100644 index 00000000..112ce9b2 --- /dev/null +++ b/examples/showcase/layouts/custom.vue @@ -0,0 +1,28 @@ + + + + + + Default #header slot content for layouts/custom.vue + + + + + + + diff --git a/examples/showcase/pages/CustomLayout.stories.ts b/examples/showcase/pages/CustomLayout.stories.ts new file mode 100644 index 00000000..70289589 --- /dev/null +++ b/examples/showcase/pages/CustomLayout.stories.ts @@ -0,0 +1,24 @@ +import CustomLayoutPage from './CustomLayout.vue' +import { NuxtLayout } from '#components' +import { provide } from 'vue' +import { PageRouteSymbol } from '#app/components/injections' +import { useRoute } from '#app/composables/router' + +const meta = { + title: 'Features/Pages as Stories with custom layout', + component: CustomLayoutPage, + tags: ['autodocs'], +} + +export default meta + +export const CustomLayoutStory = { + args: {}, + render: () => ({ + components: { CustomLayoutPage, NuxtLayout }, + setup() { + provide(PageRouteSymbol, useRoute()) + }, + template: '', + }), +} diff --git a/examples/showcase/pages/CustomLayout.vue b/examples/showcase/pages/CustomLayout.vue new file mode 100644 index 00000000..f2fd1140 --- /dev/null +++ b/examples/showcase/pages/CustomLayout.vue @@ -0,0 +1,9 @@ + + + + Custom layout defined with definePageMeta +
+ Default #header slot content for layouts/custom.vue +
layouts/custom.vue
definePageMeta