Type Signature
Parameters
string
required
The name of the layout to set for the current page.
Record<string, any>
Props to pass to the layout component.
Examples
Basic Usage
Passing Props to Layouts
You can pass props to the layout by providing an object as the second argument:Notes
If you choose to set the layout dynamically on the server side, you must do so before the layout is rendered by Vue (that is, within a plugin or route middleware) to avoid a hydration mismatch.
See Also
- Layouts Guide
- Route Middleware
definePageMeta