docs: fix example runtime hook plugin syntax (#4831)

This commit is contained in:
Jonty Brook 2022-05-06 09:48:10 +01:00 committed by GitHub
parent 6b1671181e
commit 342ecb9737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,9 +35,11 @@ App hooks can be mainly used by [Nuxt Plugins](/guide/directory-structure/plugin
### Usage with Plugins ### Usage with Plugins
```js [plugins/test.ts] ```js [plugins/test.ts]
export defineNuxtPlugin(nuxtApp) { export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('page:start', () => { }) nuxtApp.hook('page:start', () => {
} /* your code goes here */
})
})
``` ```
::alert{icon=👉} ::alert{icon=👉}