@nuxt/docs-nightly 4.3.0-29436426.3cbdaef5 → 4.3.0-29436444.647134eb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,6 +24,7 @@ Layouts are enabled by adding [`<NuxtLayout>`](/docs/4.x/api/components/nuxt-lay
|
|
|
24
24
|
To use a layout:
|
|
25
25
|
- Set a `layout` property in your page with [definePageMeta](/docs/4.x/api/utils/define-page-meta).
|
|
26
26
|
- Set the `name` prop of `<NuxtLayout>`.
|
|
27
|
+
- Set the `appLayout` property in route rules.
|
|
27
28
|
|
|
28
29
|
::note
|
|
29
30
|
The layout name is normalized to kebab-case, so `someLayout` becomes `some-layout`.
|
|
@@ -134,6 +135,19 @@ definePageMeta({
|
|
|
134
135
|
</template>
|
|
135
136
|
```
|
|
136
137
|
|
|
138
|
+
You can also set layouts for specific routes using the `appLayout` property in route rules:
|
|
139
|
+
|
|
140
|
+
```ts [nuxt.config.ts]
|
|
141
|
+
export default defineNuxtConfig({
|
|
142
|
+
routeRules: {
|
|
143
|
+
// Set layout for specific route
|
|
144
|
+
'/admin': { appLayout: 'admin' },
|
|
145
|
+
// Set layout for multiple routes
|
|
146
|
+
'/dashboard/**': { appLayout: 'dashboard' },
|
|
147
|
+
},
|
|
148
|
+
})
|
|
149
|
+
```
|
|
150
|
+
|
|
137
151
|
:link-example{to="/docs/4.x/examples/features/layouts"}
|
|
138
152
|
|
|
139
153
|
## Overriding a Layout on a Per-page Basis
|