docs: suggest using <NuxtPage> rather than <RouterView> (#25106)

This commit is contained in:
toto6038 2024-01-09 09:39:05 +00:00
parent 3d368c9c7f
commit 4168157214
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -15,6 +15,10 @@ links:
It accepts same `name` and `route` props.
::
::callout{color="amber" icon="i-ph-warning-duotone"}
`<NuxtPage>` should be used instead of `<RouterView>` as the former takes additional care on internal states. Otherwise, `useRoute()` may return incorrect paths.
::
## Props
- `name`: tells `RouterView` to render the component with the corresponding name in the matched route record's components option.