docs: mention new defineNuxtPlugin syntax in bridge migration (#23036)

This commit is contained in:
Adrien Zaganelli 2023-11-13 12:48:45 +01:00 committed by GitHub
parent 21c22c87ba
commit 36798e8c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,12 @@ import type { Plugin } from '@nuxt/types'
export default <Plugin> function (ctx, inject) {} export default <Plugin> function (ctx, inject) {}
``` ```
::alert{type="warning"}
While this example is valid, Nuxt 3 introduces a new defineNuxtPlugin function that has a slightly different signature.
::
:ReadMore{link="/docs/guide/directory-structure/plugins#creating-plugins"}
### `useRouter` and `useRoute` ### `useRouter` and `useRoute`
Nuxt Bridge provides direct replacements for these composables via [`useRouter`](/docs/api/composables/use-router) and `useRoute`. Nuxt Bridge provides direct replacements for these composables via [`useRouter`](/docs/api/composables/use-router) and `useRoute`.