mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-01 16:13:20 +00:00
docs: add layout to match custom header example (#4593)
This commit is contained in:
parent
4ca940d29a
commit
8fae863997
@ -73,7 +73,24 @@ Learn more about [defining page meta](/guide/directory-structure/pages#page-meta
|
|||||||
|
|
||||||
Even if you are using the `~/pages` integration, you can take full control by using the `<NuxtLayout>` component (which is globally available throughout your application), by setting `layout: false`.
|
Even if you are using the `~/pages` integration, you can take full control by using the `<NuxtLayout>` component (which is globally available throughout your application), by setting `layout: false`.
|
||||||
|
|
||||||
```vue
|
::code-group
|
||||||
|
|
||||||
|
```vue [layouts/custom.vue]
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<header>
|
||||||
|
<slot name="header">
|
||||||
|
Default header content
|
||||||
|
</slot>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<slot />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
```
|
||||||
|
|
||||||
|
```vue [pages/index.vue]
|
||||||
<template>
|
<template>
|
||||||
<NuxtLayout name="custom">
|
<NuxtLayout name="custom">
|
||||||
<template #header> Some header template content. </template>
|
<template #header> Some header template content. </template>
|
||||||
@ -89,6 +106,8 @@ definePageMeta({
|
|||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
## Example: changing the layout
|
## Example: changing the layout
|
||||||
|
|
||||||
You can also use a ref or computed property for your layout.
|
You can also use a ref or computed property for your layout.
|
||||||
|
Loading…
Reference in New Issue
Block a user