@nuxt/docs-nightly 4.0.0-29204565.30a3cc6d → 4.0.0-29206881.53f2acdc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,25 +58,6 @@ await nuxtApp.callHook('app:user:registered', {
|
|
|
58
58
|
You can inspect all events using the **Nuxt DevTools** Hooks panel.
|
|
59
59
|
::
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
import { HookResult } from "@nuxt/schema";
|
|
67
|
-
|
|
68
|
-
declare module '#app' {
|
|
69
|
-
interface RuntimeNuxtHooks {
|
|
70
|
-
'your-nuxt-runtime-hook': () => HookResult
|
|
71
|
-
}
|
|
72
|
-
interface NuxtHooks {
|
|
73
|
-
'your-nuxt-hook': () => HookResult
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
declare module 'nitropack/types' {
|
|
78
|
-
interface NitroRuntimeHooks {
|
|
79
|
-
'your-nitro-hook': () => void;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
61
|
+
::read-more{to="/docs/guide/going-further/hooks"}
|
|
62
|
+
Learn more about Nuxt's built-in hooks and how to extend them
|
|
63
|
+
::
|
|
@@ -74,6 +74,25 @@ export default defineNitroPlugin((nitroApp) => {
|
|
|
74
74
|
Learn more about available Nitro lifecycle hooks.
|
|
75
75
|
::
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## Adding Custom Hooks
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
You can define your own custom hooks support by extending Nuxt's hook interfaces.
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { HookResult } from "@nuxt/schema";
|
|
83
|
+
|
|
84
|
+
declare module '#app' {
|
|
85
|
+
interface RuntimeNuxtHooks {
|
|
86
|
+
'your-nuxt-runtime-hook': () => HookResult
|
|
87
|
+
}
|
|
88
|
+
interface NuxtHooks {
|
|
89
|
+
'your-nuxt-hook': () => HookResult
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare module 'nitropack/types' {
|
|
94
|
+
interface NitroRuntimeHooks {
|
|
95
|
+
'your-nitro-hook': () => void;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|