mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
docs: fix example runtime hook plugin syntax (#4831)
This commit is contained in:
parent
6b1671181e
commit
342ecb9737
@ -35,9 +35,11 @@ App hooks can be mainly used by [Nuxt Plugins](/guide/directory-structure/plugin
|
||||
### Usage with Plugins
|
||||
|
||||
```js [plugins/test.ts]
|
||||
export defineNuxtPlugin(nuxtApp) {
|
||||
nuxtApp.hook('page:start', () => { })
|
||||
}
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.hook('page:start', () => {
|
||||
/* your code goes here */
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
::alert{icon=👉}
|
||||
|
Loading…
Reference in New Issue
Block a user