Nuxt/examples/routing/layouts/pages/dynamic.vue
Clément Ollivier 1a7b570c82
docs(examples): add examples to docs (#3966)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2022-03-30 17:59:28 +02:00

33 lines
602 B
Vue

<template>
<div class="p-4">
Custom layout defined dynamically with the <code>NuxtLayout</code> component
<br>
<NuxtLayout :name="layout">
Default slot
<br>
<button class="border p-1 rounded" @click="layout ? layout = null : layout = 'custom'">
Switch layout
</button>
<template #header>
Header slot
</template>
</NuxtLayout>
<br>
<NuxtLink to="/">
Back to home
</NuxtLink>
</div>
</template>
<script>
definePageMeta({
layout: false
})
export default {
data: () => ({
layout: 'custom'
})
}
</script>