mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
docs: clarify that definePageMeta
only works in the pages directory (#5663)
Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
d4b5ff2d9d
commit
568fcaedfc
@ -81,7 +81,7 @@ const title = ref('Hello World')
|
||||
|
||||
## Example: usage with definePageMeta
|
||||
|
||||
You can use `definePageMeta` along with `useHead` to set metadata based on the current route.
|
||||
Within your `pages/` directory, you can use `definePageMeta` along with `useHead` to set metadata based on the current route.
|
||||
|
||||
For example, you can first set the current page title (this is extracted at build time via a macro, so it can't be set dynamically):
|
||||
|
||||
@ -106,3 +106,5 @@ useHead({
|
||||
```
|
||||
|
||||
:LinkExample{link="/examples/composables/use-head"}
|
||||
|
||||
:ReadMore{link="/guide/directory-structure/pages/#page-metadata"}
|
||||
|
Loading…
Reference in New Issue
Block a user