@nuxt/docs 3.20.0 → 3.20.2

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.
Files changed (208) hide show
  1. package/1.getting-started/01.introduction.md +1 -1
  2. package/1.getting-started/02.installation.md +2 -2
  3. package/1.getting-started/03.configuration.md +3 -3
  4. package/1.getting-started/04.views.md +5 -5
  5. package/1.getting-started/05.assets.md +7 -7
  6. package/1.getting-started/06.styling.md +3 -3
  7. package/1.getting-started/07.routing.md +8 -4
  8. package/1.getting-started/08.seo-meta.md +2 -2
  9. package/1.getting-started/09.transitions.md +6 -6
  10. package/1.getting-started/10.data-fetching.md +12 -12
  11. package/1.getting-started/11.state-management.md +2 -2
  12. package/1.getting-started/12.error-handling.md +3 -3
  13. package/1.getting-started/14.layers.md +31 -12
  14. package/1.getting-started/16.deployment.md +1 -1
  15. package/1.getting-started/17.testing.md +1 -1
  16. package/{2.guide/1.directory-structure → 2.directory-structure}/0.nuxt.md +1 -1
  17. package/{2.guide/1.directory-structure → 2.directory-structure}/0.output.md +1 -1
  18. package/{2.guide/1.directory-structure → 2.directory-structure}/1.assets.md +2 -2
  19. package/{2.guide/1.directory-structure → 2.directory-structure}/1.components.md +1 -1
  20. package/{2.guide/1.directory-structure → 2.directory-structure}/1.composables.md +2 -2
  21. package/{2.guide/1.directory-structure → 2.directory-structure}/1.content.md +2 -2
  22. package/{2.guide/1.directory-structure → 2.directory-structure}/1.layouts.md +2 -2
  23. package/{2.guide/1.directory-structure → 2.directory-structure}/1.middleware.md +1 -1
  24. package/{2.guide/1.directory-structure → 2.directory-structure}/1.modules.md +2 -2
  25. package/{2.guide/1.directory-structure → 2.directory-structure}/1.node_modules.md +2 -2
  26. package/{2.guide/1.directory-structure → 2.directory-structure}/1.pages.md +6 -6
  27. package/{2.guide/1.directory-structure → 2.directory-structure}/1.plugins.md +2 -2
  28. package/{2.guide/1.directory-structure → 2.directory-structure}/1.server.md +1 -1
  29. package/{2.guide/1.directory-structure → 2.directory-structure}/1.shared.md +2 -2
  30. package/{2.guide/1.directory-structure → 2.directory-structure}/1.utils.md +3 -3
  31. package/{2.guide/1.directory-structure → 2.directory-structure}/2.env.md +1 -1
  32. package/{2.guide/1.directory-structure → 2.directory-structure}/2.nuxtignore.md +1 -1
  33. package/{2.guide/1.directory-structure → 2.directory-structure}/2.nuxtrc.md +1 -1
  34. package/{2.guide/1.directory-structure → 2.directory-structure}/3.app.md +2 -2
  35. package/{2.guide/1.directory-structure → 2.directory-structure}/3.error.md +1 -3
  36. package/{2.guide/1.directory-structure → 2.directory-structure}/3.nuxt-config.md +1 -1
  37. package/{2.guide/1.directory-structure → 2.directory-structure}/3.tsconfig.md +23 -0
  38. package/2.directory-structure/index.md +61 -0
  39. package/{2.guide → 3.guide}/0.index.md +6 -9
  40. package/{2.guide/2.concepts → 3.guide/1.concepts}/1.auto-imports.md +4 -4
  41. package/{2.guide/2.concepts → 3.guide/1.concepts}/10.nuxt-lifecycle.md +3 -3
  42. package/{2.guide/2.concepts → 3.guide/1.concepts}/2.vuejs-development.md +3 -3
  43. package/{2.guide/2.concepts → 3.guide/1.concepts}/3.rendering.md +1 -1
  44. package/{2.guide/2.concepts → 3.guide/1.concepts}/4.server-engine.md +2 -2
  45. package/{2.guide/2.concepts → 3.guide/1.concepts}/5.modules.md +1 -1
  46. package/{2.guide/2.concepts → 3.guide/1.concepts}/8.typescript.md +2 -2
  47. package/{2.guide/2.concepts → 3.guide/1.concepts}/9.code-style.md +1 -1
  48. package/{2.guide/4.recipes → 3.guide/3.recipes}/1.custom-routing.md +1 -1
  49. package/{2.guide/4.recipes → 3.guide/3.recipes}/2.vite-plugin.md +3 -3
  50. package/{2.guide/4.recipes → 3.guide/3.recipes}/3.custom-usefetch.md +1 -1
  51. package/{2.guide/3.going-further → 3.guide/4.going-further}/1.experimental-features.md +6 -6
  52. package/{2.guide/3.going-further → 3.guide/4.going-further}/1.internals.md +2 -2
  53. package/{2.guide/3.going-further → 3.guide/4.going-further}/10.runtime-config.md +1 -1
  54. package/{2.guide/3.going-further → 3.guide/4.going-further}/2.hooks.md +2 -2
  55. package/{2.guide/3.going-further → 3.guide/4.going-further}/3.modules.md +3 -3
  56. package/{2.guide/3.going-further → 3.guide/4.going-further}/6.nuxt-app.md +1 -1
  57. package/{2.guide/3.going-further → 3.guide/4.going-further}/7.layers.md +41 -24
  58. package/{3.api → 4.api}/1.components/12.nuxt-route-announcer.md +1 -1
  59. package/{3.api → 4.api}/1.components/2.nuxt-page.md +1 -1
  60. package/{3.api → 4.api}/1.components/3.nuxt-layout.md +2 -2
  61. package/{3.api → 4.api}/1.components/5.nuxt-loading-indicator.md +1 -1
  62. package/{3.api → 4.api}/2.composables/use-async-data.md +76 -13
  63. package/{3.api → 4.api}/2.composables/use-cookie.md +1 -1
  64. package/{3.api → 4.api}/2.composables/use-fetch.md +1 -1
  65. package/{3.api → 4.api}/2.composables/use-head-safe.md +37 -20
  66. package/4.api/2.composables/use-head.md +169 -0
  67. package/{3.api → 4.api}/2.composables/use-hydration.md +24 -18
  68. package/4.api/2.composables/use-lazy-async-data.md +96 -0
  69. package/4.api/2.composables/use-lazy-fetch.md +111 -0
  70. package/{3.api → 4.api}/2.composables/use-nuxt-app.md +5 -5
  71. package/{3.api → 4.api}/2.composables/use-nuxt-data.md +1 -1
  72. package/{3.api → 4.api}/2.composables/use-request-fetch.md +1 -1
  73. package/{3.api → 4.api}/2.composables/use-response-header.md +1 -1
  74. package/{3.api → 4.api}/2.composables/use-route.md +1 -1
  75. package/{3.api → 4.api}/2.composables/use-router.md +1 -1
  76. package/{3.api → 4.api}/2.composables/use-runtime-hook.md +1 -1
  77. package/{3.api → 4.api}/3.utils/$fetch.md +1 -1
  78. package/{3.api → 4.api}/3.utils/abort-navigation.md +1 -1
  79. package/{3.api → 4.api}/3.utils/add-route-middleware.md +1 -1
  80. package/{3.api → 4.api}/3.utils/define-nuxt-plugin.md +1 -1
  81. package/{3.api → 4.api}/3.utils/define-nuxt-route-middleware.md +1 -1
  82. package/{3.api → 4.api}/3.utils/define-page-meta.md +5 -5
  83. package/{3.api → 4.api}/3.utils/navigate-to.md +1 -1
  84. package/{3.api → 4.api}/3.utils/refresh-cookie.md +2 -2
  85. package/{3.api → 4.api}/3.utils/update-app-config.md +1 -1
  86. package/{3.api → 4.api}/4.commands/module.md +2 -2
  87. package/{3.api → 4.api}/4.commands/prepare.md +1 -1
  88. package/{3.api → 4.api}/4.commands/preview.md +1 -1
  89. package/{3.api → 4.api}/4.commands/typecheck.md +1 -1
  90. package/{3.api → 4.api}/5.kit/1.modules.md +1 -1
  91. package/{3.api → 4.api}/5.kit/2.programmatic.md +2 -2
  92. package/{3.api → 4.api}/5.kit/5.components.md +1 -1
  93. package/{3.api → 4.api}/6.advanced/1.hooks.md +1 -1
  94. package/5.community/3.reporting-bugs.md +1 -1
  95. package/5.community/6.roadmap.md +6 -6
  96. package/5.community/7.changelog.md +10 -0
  97. package/6.bridge/1.overview.md +1 -1
  98. package/6.bridge/4.plugins-and-middleware.md +2 -2
  99. package/7.migration/2.configuration.md +1 -1
  100. package/7.migration/3.auto-imports.md +1 -1
  101. package/7.migration/6.pages-and-layouts.md +4 -4
  102. package/package.json +1 -1
  103. package/3.api/2.composables/use-head.md +0 -69
  104. package/3.api/2.composables/use-lazy-async-data.md +0 -47
  105. package/3.api/2.composables/use-lazy-fetch.md +0 -55
  106. /package/{2.guide/1.directory-structure → 2.directory-structure}/.navigation.yml +0 -0
  107. /package/{2.guide/1.directory-structure → 2.directory-structure}/1.public.md +0 -0
  108. /package/{2.guide/1.directory-structure → 2.directory-structure}/2.gitignore.md +0 -0
  109. /package/{2.guide/1.directory-structure → 2.directory-structure}/3.app-config.md +0 -0
  110. /package/{2.guide/1.directory-structure → 2.directory-structure}/3.package.md +0 -0
  111. /package/{2.guide → 3.guide}/.navigation.yml +0 -0
  112. /package/{2.guide/2.concepts → 3.guide/1.concepts}/.navigation.yml +0 -0
  113. /package/{2.guide/2.concepts → 3.guide/1.concepts}/7.esm.md +0 -0
  114. /package/{2.guide/5.best-practices → 3.guide/2.best-practices}/.navigation.yml +0 -0
  115. /package/{2.guide/5.best-practices → 3.guide/2.best-practices}/hydration.md +0 -0
  116. /package/{2.guide/5.best-practices → 3.guide/2.best-practices}/performance.md +0 -0
  117. /package/{2.guide/5.best-practices → 3.guide/2.best-practices}/plugins.md +0 -0
  118. /package/{2.guide/4.recipes → 3.guide/3.recipes}/.navigation.yml +0 -0
  119. /package/{2.guide/4.recipes → 3.guide/3.recipes}/4.sessions-and-authentication.md +0 -0
  120. /package/{2.guide/3.going-further → 3.guide/4.going-further}/.navigation.yml +0 -0
  121. /package/{2.guide/3.going-further → 3.guide/4.going-further}/1.events.md +0 -0
  122. /package/{2.guide/3.going-further → 3.guide/4.going-further}/1.features.md +0 -0
  123. /package/{2.guide/3.going-further → 3.guide/4.going-further}/11.nightly-release-channel.md +0 -0
  124. /package/{2.guide/3.going-further → 3.guide/4.going-further}/4.kit.md +0 -0
  125. /package/{2.guide/3.going-further → 3.guide/4.going-further}/9.debugging.md +0 -0
  126. /package/{2.guide/3.going-further → 3.guide/4.going-further}/index.md +0 -0
  127. /package/{3.api → 4.api}/.navigation.yml +0 -0
  128. /package/{3.api → 4.api}/1.components/.navigation.yml +0 -0
  129. /package/{3.api → 4.api}/1.components/1.client-only.md +0 -0
  130. /package/{3.api → 4.api}/1.components/1.dev-only.md +0 -0
  131. /package/{3.api → 4.api}/1.components/1.nuxt-client-fallback.md +0 -0
  132. /package/{3.api → 4.api}/1.components/10.nuxt-picture.md +0 -0
  133. /package/{3.api → 4.api}/1.components/11.teleports.md +0 -0
  134. /package/{3.api → 4.api}/1.components/13.nuxt-time.md +0 -0
  135. /package/{3.api → 4.api}/1.components/4.nuxt-link.md +0 -0
  136. /package/{3.api → 4.api}/1.components/6.nuxt-error-boundary.md +0 -0
  137. /package/{3.api → 4.api}/1.components/7.nuxt-welcome.md +0 -0
  138. /package/{3.api → 4.api}/1.components/8.nuxt-island.md +0 -0
  139. /package/{3.api → 4.api}/1.components/9.nuxt-img.md +0 -0
  140. /package/{3.api → 4.api}/2.composables/.navigation.yml +0 -0
  141. /package/{3.api → 4.api}/2.composables/on-prehydrate.md +0 -0
  142. /package/{3.api → 4.api}/2.composables/use-app-config.md +0 -0
  143. /package/{3.api → 4.api}/2.composables/use-error.md +0 -0
  144. /package/{3.api → 4.api}/2.composables/use-loading-indicator.md +0 -0
  145. /package/{3.api → 4.api}/2.composables/use-preview-mode.md +0 -0
  146. /package/{3.api → 4.api}/2.composables/use-request-event.md +0 -0
  147. /package/{3.api → 4.api}/2.composables/use-request-header.md +0 -0
  148. /package/{3.api → 4.api}/2.composables/use-request-headers.md +0 -0
  149. /package/{3.api → 4.api}/2.composables/use-request-url.md +0 -0
  150. /package/{3.api → 4.api}/2.composables/use-route-announcer.md +0 -0
  151. /package/{3.api → 4.api}/2.composables/use-runtime-config.md +0 -0
  152. /package/{3.api → 4.api}/2.composables/use-seo-meta.md +0 -0
  153. /package/{3.api → 4.api}/2.composables/use-server-seo-meta.md +0 -0
  154. /package/{3.api → 4.api}/2.composables/use-state.md +0 -0
  155. /package/{3.api → 4.api}/3.utils/.navigation.yml +0 -0
  156. /package/{3.api → 4.api}/3.utils/call-once.md +0 -0
  157. /package/{3.api → 4.api}/3.utils/clear-error.md +0 -0
  158. /package/{3.api → 4.api}/3.utils/clear-nuxt-data.md +0 -0
  159. /package/{3.api → 4.api}/3.utils/clear-nuxt-state.md +0 -0
  160. /package/{3.api → 4.api}/3.utils/create-error.md +0 -0
  161. /package/{3.api → 4.api}/3.utils/define-lazy-hydration-component.md +0 -0
  162. /package/{3.api → 4.api}/3.utils/define-nuxt-component.md +0 -0
  163. /package/{3.api → 4.api}/3.utils/define-route-rules.md +0 -0
  164. /package/{3.api → 4.api}/3.utils/on-before-route-leave.md +0 -0
  165. /package/{3.api → 4.api}/3.utils/on-before-route-update.md +0 -0
  166. /package/{3.api → 4.api}/3.utils/on-nuxt-ready.md +0 -0
  167. /package/{3.api → 4.api}/3.utils/prefetch-components.md +0 -0
  168. /package/{3.api → 4.api}/3.utils/preload-components.md +0 -0
  169. /package/{3.api → 4.api}/3.utils/preload-route-components.md +0 -0
  170. /package/{3.api → 4.api}/3.utils/prerender-routes.md +0 -0
  171. /package/{3.api → 4.api}/3.utils/refresh-nuxt-data.md +0 -0
  172. /package/{3.api → 4.api}/3.utils/reload-nuxt-app.md +0 -0
  173. /package/{3.api → 4.api}/3.utils/set-page-layout.md +0 -0
  174. /package/{3.api → 4.api}/3.utils/set-response-status.md +0 -0
  175. /package/{3.api → 4.api}/3.utils/show-error.md +0 -0
  176. /package/{3.api → 4.api}/4.commands/.navigation.yml +0 -0
  177. /package/{3.api → 4.api}/4.commands/add.md +0 -0
  178. /package/{3.api → 4.api}/4.commands/analyze.md +0 -0
  179. /package/{3.api → 4.api}/4.commands/build-module.md +0 -0
  180. /package/{3.api → 4.api}/4.commands/build.md +0 -0
  181. /package/{3.api → 4.api}/4.commands/cleanup.md +0 -0
  182. /package/{3.api → 4.api}/4.commands/dev.md +0 -0
  183. /package/{3.api → 4.api}/4.commands/devtools.md +0 -0
  184. /package/{3.api → 4.api}/4.commands/generate.md +0 -0
  185. /package/{3.api → 4.api}/4.commands/info.md +0 -0
  186. /package/{3.api → 4.api}/4.commands/init.md +0 -0
  187. /package/{3.api → 4.api}/4.commands/test.md +0 -0
  188. /package/{3.api → 4.api}/4.commands/upgrade.md +0 -0
  189. /package/{3.api → 4.api}/5.kit/.navigation.yml +0 -0
  190. /package/{3.api → 4.api}/5.kit/10.runtime-config.md +0 -0
  191. /package/{3.api → 4.api}/5.kit/10.templates.md +0 -0
  192. /package/{3.api → 4.api}/5.kit/11.nitro.md +0 -0
  193. /package/{3.api → 4.api}/5.kit/12.resolving.md +0 -0
  194. /package/{3.api → 4.api}/5.kit/13.logging.md +0 -0
  195. /package/{3.api → 4.api}/5.kit/14.builder.md +0 -0
  196. /package/{3.api → 4.api}/5.kit/15.examples.md +0 -0
  197. /package/{3.api → 4.api}/5.kit/16.layers.md +0 -0
  198. /package/{3.api → 4.api}/5.kit/3.compatibility.md +0 -0
  199. /package/{3.api → 4.api}/5.kit/4.autoimports.md +0 -0
  200. /package/{3.api → 4.api}/5.kit/6.context.md +0 -0
  201. /package/{3.api → 4.api}/5.kit/7.pages.md +0 -0
  202. /package/{3.api → 4.api}/5.kit/8.layout.md +0 -0
  203. /package/{3.api → 4.api}/5.kit/9.head.md +0 -0
  204. /package/{3.api → 4.api}/5.kit/9.plugins.md +0 -0
  205. /package/{3.api → 4.api}/6.advanced/.navigation.yml +0 -0
  206. /package/{3.api → 4.api}/6.advanced/2.import-meta.md +0 -0
  207. /package/{3.api → 4.api}/6.nuxt-config.md +0 -0
  208. /package/{3.api → 4.api}/index.md +0 -0
@@ -8,6 +8,8 @@ links:
8
8
  size: xs
9
9
  ---
10
10
 
11
+ `useHydration` is a built-in composable that provides a way to set data on the server side every time a new HTTP request is made and receive that data on the client side. This way `useHydration` allows you to take full control of the hydration cycle.
12
+
11
13
  ::note
12
14
  This is an advanced composable, primarily designed for use within plugins, mostly used by Nuxt modules.
13
15
  ::
@@ -16,14 +18,24 @@ This is an advanced composable, primarily designed for use within plugins, mostl
16
18
  `useHydration` is designed to **ensure state synchronization and restoration during SSR**. If you need to create a globally reactive state that is SSR-friendly in Nuxt, [`useState`](/docs/3.x/api/composables/use-state) is the recommended choice.
17
19
  ::
18
20
 
19
- `useHydration` is a built-in composable that provides a way to set data on the server side every time a new HTTP request is made and receive that data on the client side. This way `useHydration` allows you to take full control of the hydration cycle.
21
+ ## Usage
20
22
 
21
23
  The data returned from the `get` function on the server is stored in `nuxtApp.payload` under the unique key provided as the first parameter to `useHydration`. During hydration, this data is then retrieved on the client, preventing redundant computations or API calls.
22
24
 
23
- ## Usage
24
-
25
25
  ::code-group
26
26
 
27
+ ```ts [With useHydration]
28
+ export default defineNuxtPlugin((nuxtApp) => {
29
+ const myStore = new MyStore()
30
+
31
+ useHydration(
32
+ 'myStoreState',
33
+ () => myStore.getState(),
34
+ data => myStore.setState(data),
35
+ )
36
+ })
37
+ ```
38
+
27
39
  ```ts [Without useHydration]
28
40
  export default defineNuxtPlugin((nuxtApp) => {
29
41
  const myStore = new MyStore()
@@ -41,18 +53,6 @@ export default defineNuxtPlugin((nuxtApp) => {
41
53
  }
42
54
  })
43
55
  ```
44
-
45
- ```ts [With useHydration]
46
- export default defineNuxtPlugin((nuxtApp) => {
47
- const myStore = new MyStore()
48
-
49
- useHydration(
50
- 'myStoreState',
51
- () => myStore.getState(),
52
- data => myStore.setState(data),
53
- )
54
- })
55
- ```
56
56
  ::
57
57
 
58
58
  ## Type
@@ -63,6 +63,12 @@ export function useHydration<T> (key: string, get: () => T, set: (value: T) => v
63
63
 
64
64
  ## Parameters
65
65
 
66
- - `key`: A unique key that identifies the data in your Nuxt application.
67
- - `get`: A function executed **only on the server** (called when SSR rendering is done) to set the initial value.
68
- - `set`: A function executed **only on the client** (called when initial vue instance is created) to receive the data.
66
+ | Parameter | Type | Description |
67
+ | --- | --- | --- |
68
+ | `key` | `string` | A unique key that identifies the data in your Nuxt application. |
69
+ | `get` | `() => T` | A function executed **only on the server** (called when SSR rendering is done) to set the initial value. |
70
+ | `set` | `(value: T) => void` | A function executed **only on the client** (called when initial Vue instance is created) to receive the data. |
71
+
72
+ ## Return Values
73
+
74
+ This composable does not return any value.
@@ -0,0 +1,96 @@
1
+ ---
2
+ title: useLazyAsyncData
3
+ description: This wrapper around useAsyncData triggers navigation immediately.
4
+ links:
5
+ - label: Source
6
+ icon: i-simple-icons-github
7
+ to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/asyncData.ts
8
+ size: xs
9
+ ---
10
+
11
+ `useLazyAsyncData` provides a wrapper around [`useAsyncData`](/docs/3.x/api/composables/use-async-data) that triggers navigation before the handler is resolved by setting the `lazy` option to `true`.
12
+
13
+ ::note
14
+ By default, [`useAsyncData`](/docs/3.x/api/composables/use-async-data) blocks navigation until its async handler is resolved. `useLazyAsyncData` allows navigation to occur immediately while data fetching continues in the background.
15
+ ::
16
+
17
+ ## Usage
18
+
19
+ ```vue [app/pages/index.vue]
20
+ <script setup lang="ts">
21
+ const { status, data: posts } = await useLazyAsyncData('posts', () => $fetch('/api/posts'))
22
+ </script>
23
+
24
+ <template>
25
+ <div>
26
+ <div v-if="status === 'pending'">
27
+ Loading...
28
+ </div>
29
+ <div v-else-if="status === 'error'">
30
+ Error loading posts
31
+ </div>
32
+ <div v-else>
33
+ {{ posts }}
34
+ </div>
35
+ </div>
36
+ </template>
37
+ ```
38
+
39
+ When using `useLazyAsyncData`, navigation will occur before fetching is complete. This means you must handle `pending` and `error` states directly within your component's template.
40
+
41
+ ::warning
42
+ `useLazyAsyncData` is a reserved function name transformed by the compiler, so you should not name your own function `useLazyAsyncData`.
43
+ ::
44
+
45
+ ## Type
46
+
47
+ ```ts [Signature]
48
+ export function useLazyAsyncData<DataT, ErrorT> (
49
+ handler: (ctx?: NuxtApp) => Promise<DataT>,
50
+ options?: AsyncDataOptions<DataT>,
51
+ ): AsyncData<DataT, ErrorT>
52
+
53
+ export function useLazyAsyncData<DataT, ErrorT> (
54
+ key: string,
55
+ handler: (ctx?: NuxtApp) => Promise<DataT>,
56
+ options?: AsyncDataOptions<DataT>,
57
+ ): AsyncData<DataT, ErrorT>
58
+ ```
59
+
60
+ `useLazyAsyncData` has the same signature as [`useAsyncData`](/docs/3.x/api/composables/use-async-data).
61
+
62
+ ## Parameters
63
+
64
+ `useLazyAsyncData` accepts the same parameters as [`useAsyncData`](/docs/3.x/api/composables/use-async-data), with the `lazy` option automatically set to `true`.
65
+
66
+ :read-more{to="/docs/3.x/api/composables/use-async-data#parameters"}
67
+
68
+ ## Return Values
69
+
70
+ `useLazyAsyncData` returns the same values as [`useAsyncData`](/docs/3.x/api/composables/use-async-data).
71
+
72
+ :read-more{to="/docs/3.x/api/composables/use-async-data#return-values"}
73
+
74
+ ## Example
75
+
76
+ ```vue [pages/index.vue]
77
+ <script setup lang="ts">
78
+ /* Navigation will occur before fetching is complete.
79
+ Handle 'pending' and 'error' states directly within your component's template
80
+ */
81
+ const { status, data: count } = await useLazyAsyncData('count', () => $fetch('/api/count'))
82
+
83
+ watch(count, (newCount) => {
84
+ // Because count might start out null, you won't have access
85
+ // to its contents immediately, but you can watch it.
86
+ })
87
+ </script>
88
+
89
+ <template>
90
+ <div>
91
+ {{ status === 'pending' ? 'Loading' : count }}
92
+ </div>
93
+ </template>
94
+ ```
95
+
96
+ :read-more{to="/docs/3.x/getting-started/data-fetching"}
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: 'useLazyFetch'
3
+ description: This wrapper around useFetch triggers navigation immediately.
4
+ links:
5
+ - label: Source
6
+ icon: i-simple-icons-github
7
+ to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/composables/fetch.ts
8
+ size: xs
9
+ ---
10
+
11
+ `useLazyFetch` provides a wrapper around [`useFetch`](/docs/3.x/api/composables/use-fetch) that triggers navigation before the handler is resolved by setting the `lazy` option to `true`.
12
+
13
+ ## Usage
14
+
15
+ By default, [`useFetch`](/docs/3.x/api/composables/use-fetch) blocks navigation until its async handler is resolved. `useLazyFetch` allows navigation to proceed immediately, with data being fetched in the background.
16
+
17
+ ```vue [app/pages/index.vue]
18
+ <script setup lang="ts">
19
+ const { status, data: posts } = await useLazyFetch('/api/posts')
20
+ </script>
21
+
22
+ <template>
23
+ <div v-if="status === 'pending'">
24
+ Loading ...
25
+ </div>
26
+ <div v-else>
27
+ <div v-for="post in posts">
28
+ <!-- do something -->
29
+ </div>
30
+ </div>
31
+ </template>
32
+ ```
33
+
34
+ ::note
35
+ `useLazyFetch` has the same signature as [`useFetch`](/docs/3.x/api/composables/use-fetch).
36
+ ::
37
+
38
+ ::warning
39
+ Awaiting `useLazyFetch` only ensures the call is initialized. On client-side navigation, data may not be immediately available, and you must handle the `pending` state in your component's template.
40
+ ::
41
+
42
+ ::warning
43
+ `useLazyFetch` is a reserved function name transformed by the compiler, so you should not name your own function `useLazyFetch`.
44
+ ::
45
+
46
+ ## Type
47
+
48
+ ```ts [Signature]
49
+ export function useLazyFetch<DataT, ErrorT> (
50
+ url: string | Request | Ref<string | Request> | (() => string | Request),
51
+ options?: UseFetchOptions<DataT>,
52
+ ): Promise<AsyncData<DataT, ErrorT>>
53
+ ```
54
+
55
+ ::note
56
+ `useLazyFetch` is equivalent to `useFetch` with `lazy: true` option set. See [`useFetch`](/docs/3.x/api/composables/use-fetch) for full type definitions.
57
+ ::
58
+
59
+ ## Parameters
60
+
61
+ `useLazyFetch` accepts the same parameters as [`useFetch`](/docs/3.x/api/composables/use-fetch):
62
+
63
+ - `URL` (`string | Request | Ref<string | Request> | () => string | Request`): The URL or request to fetch.
64
+ - `options` (object): Same as [`useFetch` options](/docs/3.x/api/composables/use-fetch#parameters), with `lazy` automatically set to `true`.
65
+
66
+ :read-more{to="/docs/3.x/api/composables/use-fetch#parameters"}
67
+
68
+ ## Return Values
69
+
70
+ Returns the same `AsyncData` object as [`useFetch`](/docs/3.x/api/composables/use-fetch):
71
+
72
+ | Name | Type | Description |
73
+ | --- | --- |--- |
74
+ | `data` | `Ref<DataT \| undefined>` | The result of the asynchronous fetch. |
75
+ | `refresh` | `(opts?: AsyncDataExecuteOptions) => Promise<void>` | Function to manually refresh the data. |
76
+ | `execute` | `(opts?: AsyncDataExecuteOptions) => Promise<void>` | Alias for `refresh`. |
77
+ | `error` | `Ref<ErrorT \| undefined>` | Error object if the data fetching failed. |
78
+ | `status` | `Ref<'idle' \| 'pending' \| 'success' \| 'error'>` | Status of the data request. |
79
+ | `clear` | `() => void` | Resets `data` to `undefined`, `error` to `undefined`, sets `status` to `idle`, and cancels any pending requests. |
80
+
81
+ :read-more{to="/docs/3.x/api/composables/use-fetch#return-values"}
82
+
83
+ ## Examples
84
+
85
+ ### Handling Pending State
86
+
87
+ ```vue [pages/index.vue]
88
+ <script setup lang="ts">
89
+ /* Navigation will occur before fetching is complete.
90
+ * Handle 'pending' and 'error' states directly within your component's template
91
+ */
92
+ const { status, data: posts } = await useLazyFetch('/api/posts')
93
+ watch(posts, (newPosts) => {
94
+ // Because posts might start out null, you won't have access
95
+ // to its contents immediately, but you can watch it.
96
+ })
97
+ </script>
98
+
99
+ <template>
100
+ <div v-if="status === 'pending'">
101
+ Loading ...
102
+ </div>
103
+ <div v-else>
104
+ <div v-for="post in posts">
105
+ <!-- do something -->
106
+ </div>
107
+ </div>
108
+ </template>
109
+ ```
110
+
111
+ :read-more{to="/docs/3.x/getting-started/data-fetching"}
@@ -30,7 +30,7 @@ By default, the shared runtime context of Nuxt is namespaced under the [`buildId
30
30
 
31
31
  ### `provide (name, value)`
32
32
 
33
- `nuxtApp` is a runtime context that you can extend using [Nuxt plugins](/docs/3.x/guide/directory-structure/plugins). Use the `provide` function to create Nuxt plugins to make values and helper methods available in your Nuxt application across all composables and components.
33
+ `nuxtApp` is a runtime context that you can extend using [Nuxt plugins](/docs/3.x/directory-structure/plugins). Use the `provide` function to create Nuxt plugins to make values and helper methods available in your Nuxt application across all composables and components.
34
34
 
35
35
  `provide` function accepts `name` and `value` parameters.
36
36
 
@@ -46,7 +46,7 @@ As you can see in the example above, `$hello` has become the new and custom part
46
46
 
47
47
  ### `hook(name, cb)`
48
48
 
49
- Hooks available in `nuxtApp` allows you to customize the runtime aspects of your Nuxt application. You can use runtime hooks in Vue.js composables and [Nuxt plugins](/docs/3.x/guide/directory-structure/plugins) to hook into the rendering lifecycle.
49
+ Hooks available in `nuxtApp` allows you to customize the runtime aspects of your Nuxt application. You can use runtime hooks in Vue.js composables and [Nuxt plugins](/docs/3.x/directory-structure/plugins) to hook into the rendering lifecycle.
50
50
 
51
51
  `hook` function is useful for adding custom logic by hooking into the rendering lifecycle at a specific point. `hook` function is mostly used when creating Nuxt plugins.
52
52
 
@@ -84,8 +84,8 @@ await nuxtApp.callHook('my-plugin:init')
84
84
 
85
85
  Some useful methods:
86
86
  - [`component()`](https://vuejs.org/api/application.html#app-component) - Registers a global component if passing both a name string and a component definition, or retrieves an already registered one if only the name is passed.
87
- - [`directive()`](https://vuejs.org/api/application.html#app-directive) - Registers a global custom directive if passing both a name string and a directive definition, or retrieves an already registered one if only the name is passed[(example)](/docs/3.x/guide/directory-structure/plugins#vue-directives).
88
- - [`use()`](https://vuejs.org/api/application.html#app-use) - Installs a **[Vue.js Plugin](https://vuejs.org/guide/reusability/plugins.html)** [(example)](/docs/3.x/guide/directory-structure/plugins#vue-plugins).
87
+ - [`directive()`](https://vuejs.org/api/application.html#app-directive) - Registers a global custom directive if passing both a name string and a directive definition, or retrieves an already registered one if only the name is passed[(example)](/docs/3.x/directory-structure/plugins#vue-directives).
88
+ - [`use()`](https://vuejs.org/api/application.html#app-use) - Installs a **[Vue.js Plugin](https://vuejs.org/guide/reusability/plugins.html)** [(example)](/docs/3.x/directory-structure/plugins#vue-plugins).
89
89
 
90
90
  :read-more{icon="i-simple-icons-vuedotjs" to="https://vuejs.org/api/application.html#application-api"}
91
91
 
@@ -108,7 +108,7 @@ Nuxt exposes the following properties through `ssrContext`:
108
108
  ::code-group
109
109
  ```vue [app.vue]
110
110
  <script setup lang="ts">
111
- const { data } = await useAsyncData('count', () => $fetch('/api/count'))
111
+ const { data } = await useAsyncData('count', (_nuxtApp, { signal }) => $fetch('/api/count', { signal }))
112
112
  </script>
113
113
  ```
114
114
  ```ts [server/api/count.ts]
@@ -67,7 +67,7 @@ Optimistic Updates is a technique where the user interface is updated immediatel
67
67
  ```vue [pages/todos.vue]
68
68
  <script setup lang="ts">
69
69
  // We can access same data later using 'todos' key
70
- const { data } = await useAsyncData('todos', () => $fetch('/api/todos'))
70
+ const { data } = await useAsyncData('todos', (_nuxtApp, { signal }) => $fetch('/api/todos', { signal }))
71
71
  </script>
72
72
  ```
73
73
 
@@ -33,7 +33,7 @@ const { data: forwarded } = await useAsyncData(() => requestFetch('/api/cookies'
33
33
 
34
34
  // This will NOT forward anything
35
35
  // Result: { cookies: {} }
36
- const { data: notForwarded } = await useAsyncData(() => $fetch('/api/cookies'))
36
+ const { data: notForwarded } = await useAsyncData((_nuxtApp, { signal }) => $fetch('/api/cookies', { signal }))
37
37
  </script>
38
38
  ```
39
39
 
@@ -37,7 +37,7 @@ header.value = 'my-value'
37
37
  </template>
38
38
  ```
39
39
 
40
- We can use `useResponseHeader` for example in Nuxt [middleware](/docs/3.x/guide/directory-structure/middleware) to set a response header for all pages.
40
+ We can use `useResponseHeader` for example in Nuxt [middleware](/docs/3.x/directory-structure/middleware) to set a response header for all pages.
41
41
 
42
42
  ```ts [middleware/my-header-middleware.ts]
43
43
  export default defineNuxtRouteMiddleware((to, from) => {
@@ -76,7 +76,7 @@ The `useRoute()` composable should only be used in the setup function of a Vue c
76
76
  This applies to any composable that uses `useRoute()` internally too.
77
77
  ::
78
78
 
79
- ::read-more{to="/docs/4.x/guide/directory-structure/app/middleware"}
79
+ ::read-more{to="/docs/3.x/directory-structure/app/middleware"}
80
80
  Read more about accessing the route in the middleware section.
81
81
  ::
82
82
 
@@ -49,7 +49,7 @@ router.resolve({ name: 'home' })
49
49
  ```
50
50
 
51
51
  ::note
52
- `router.addRoute()` adds route details into an array of routes and it is useful while building [Nuxt plugins](/docs/3.x/guide/directory-structure/plugins) while `router.push()` on the other hand, triggers a new navigation immediately and it is useful in pages, Vue components and composable.
52
+ `router.addRoute()` adds route details into an array of routes and it is useful while building [Nuxt plugins](/docs/3.x/directory-structure/plugins) while `router.push()` on the other hand, triggers a new navigation immediately and it is useful in pages, Vue components and composable.
53
53
  ::
54
54
 
55
55
  ## Based on History API
@@ -15,7 +15,7 @@ This composable is available in Nuxt v3.14+.
15
15
  ```ts [signature]
16
16
  function useRuntimeHook<THookName extends keyof RuntimeNuxtHooks> (
17
17
  name: THookName,
18
- fn: RuntimeNuxtHooks[THookName] extends HookCallback ? RuntimeNuxtHooks[THookName] : never
18
+ fn: RuntimeNuxtHooks[THookName] extends HookCallback ? RuntimeNuxtHooks[THookName] : never,
19
19
  ): void
20
20
  ```
21
21
 
@@ -11,7 +11,7 @@ links:
11
11
  Nuxt uses [ofetch](https://github.com/unjs/ofetch) to expose globally the `$fetch` helper for making HTTP requests within your Vue app or API routes.
12
12
 
13
13
  ::tip{icon="i-lucide-rocket"}
14
- During server-side rendering, calling `$fetch` to fetch your internal [API routes](/docs/3.x/guide/directory-structure/server) will directly call the relevant function (emulating the request), **saving an additional API call**.
14
+ During server-side rendering, calling `$fetch` to fetch your internal [API routes](/docs/3.x/directory-structure/server) will directly call the relevant function (emulating the request), **saving an additional API call**.
15
15
  ::
16
16
 
17
17
  ::note{color="blue" icon="i-lucide-info"}
@@ -9,7 +9,7 @@ links:
9
9
  ---
10
10
 
11
11
  ::warning
12
- `abortNavigation` is only usable inside a [route middleware handler](/docs/3.x/guide/directory-structure/middleware).
12
+ `abortNavigation` is only usable inside a [route middleware handler](/docs/3.x/directory-structure/middleware).
13
13
  ::
14
14
 
15
15
  ## Type
@@ -9,7 +9,7 @@ links:
9
9
  ---
10
10
 
11
11
  ::note
12
- Route middleware are navigation guards stored in the [`middleware/`](/docs/3.x/guide/directory-structure/middleware) directory of your Nuxt application (unless [set otherwise](/docs/3.x/api/nuxt-config#middleware)).
12
+ Route middleware are navigation guards stored in the [`middleware/`](/docs/3.x/directory-structure/middleware) directory of your Nuxt application (unless [set otherwise](/docs/3.x/api/nuxt-config#middleware)).
13
13
  ::
14
14
 
15
15
  ## Type
@@ -42,7 +42,7 @@ interface ObjectPlugin<T> {
42
42
  ## Parameters
43
43
 
44
44
  **plugin**: A plugin can be defined in two ways:
45
- 1. **Function Plugin**: A function that receives the [`NuxtApp`](/docs/3.x/guide/going-further/internals#the-nuxtapp-interface) instance and can return a promise with an potential object with a [`provide`](/docs/3.x/guide/directory-structure/plugins#providing-helpers) property if you want to provide a helper on [`NuxtApp`](/docs/3.x/guide/going-further/internals#the-nuxtapp-interface) instance.
45
+ 1. **Function Plugin**: A function that receives the [`NuxtApp`](/docs/3.x/guide/going-further/internals#the-nuxtapp-interface) instance and can return a promise with an potential object with a [`provide`](/docs/3.x/directory-structure/plugins#providing-helpers) property if you want to provide a helper on [`NuxtApp`](/docs/3.x/guide/going-further/internals#the-nuxtapp-interface) instance.
46
46
  2. **Object Plugin**: An object that can include various properties to configure the plugin's behavior, such as `name`, `enforce`, `dependsOn`, `order`, `parallel`, `setup`, `hooks`, and `env`.
47
47
 
48
48
  | Property | Type | Required | Description |
@@ -8,7 +8,7 @@ links:
8
8
  size: xs
9
9
  ---
10
10
 
11
- Route middleware are stored in the [`middleware/`](/docs/3.x/guide/directory-structure/middleware) of your Nuxt application (unless [set otherwise](/docs/3.x/api/nuxt-config#middleware)).
11
+ Route middleware are stored in the [`middleware/`](/docs/3.x/directory-structure/middleware) of your Nuxt application (unless [set otherwise](/docs/3.x/api/nuxt-config#middleware)).
12
12
 
13
13
  ## Type
14
14
 
@@ -8,7 +8,7 @@ links:
8
8
  size: xs
9
9
  ---
10
10
 
11
- `definePageMeta` is a compiler macro that you can use to set metadata for your **page** components located in the [`pages/`](/docs/3.x/guide/directory-structure/pages) directory (unless [set otherwise](/docs/3.x/api/nuxt-config#pages)). This way you can set custom metadata for each static or dynamic route of your Nuxt application.
11
+ `definePageMeta` is a compiler macro that you can use to set metadata for your **page** components located in the [`pages/`](/docs/3.x/directory-structure/pages) directory (unless [set otherwise](/docs/3.x/api/nuxt-config#pages)). This way you can set custom metadata for each static or dynamic route of your Nuxt application.
12
12
 
13
13
  ```vue [pages/some-page.vue]
14
14
  <script setup lang="ts">
@@ -56,7 +56,7 @@ interface PageMeta {
56
56
 
57
57
  - **Type**: `string`
58
58
 
59
- You may define a name for this page's route. By default, name is generated based on path inside the [`pages/` directory](/docs/3.x/guide/directory-structure/pages).
59
+ You may define a name for this page's route. By default, name is generated based on path inside the [`pages/` directory](/docs/3.x/directory-structure/pages).
60
60
 
61
61
  **`path`**
62
62
 
@@ -104,7 +104,7 @@ interface PageMeta {
104
104
 
105
105
  - **Type**: `MiddlewareKey` | [`NavigationGuard`](https://router.vuejs.org/api/interfaces/NavigationGuard.html#navigationguard) | `Array<MiddlewareKey | NavigationGuard>`
106
106
 
107
- Define anonymous or named middleware directly within `definePageMeta`. Learn more about [route middleware](/docs/3.x/guide/directory-structure/middleware).
107
+ Define anonymous or named middleware directly within `definePageMeta`. Learn more about [route middleware](/docs/3.x/directory-structure/middleware).
108
108
 
109
109
  **`pageTransition`**
110
110
 
@@ -142,7 +142,7 @@ interface PageMeta {
142
142
 
143
143
  - **Type**: `any`
144
144
 
145
- Apart from the above properties, you can also set **custom** metadata. You may wish to do so in a type-safe way by [augmenting the type of the `meta` object](/docs/3.x/guide/directory-structure/pages/#typing-custom-metadata).
145
+ Apart from the above properties, you can also set **custom** metadata. You may wish to do so in a type-safe way by [augmenting the type of the `meta` object](/docs/3.x/directory-structure/pages/#typing-custom-metadata).
146
146
 
147
147
  ## Examples
148
148
 
@@ -219,7 +219,7 @@ For more examples see [Vue Router's Matching Syntax](https://router.vuejs.org/gu
219
219
 
220
220
  ### Defining Layout
221
221
 
222
- You can define the layout that matches the layout's file name located (by default) in the [`layouts/` directory](/docs/3.x/guide/directory-structure/layouts). You can also disable the layout by setting the `layout` to `false`:
222
+ You can define the layout that matches the layout's file name located (by default) in the [`layouts/` directory](/docs/3.x/directory-structure/layouts). You can also disable the layout by setting the `layout` to `false`:
223
223
 
224
224
  ```vue [pages/some-page.vue]
225
225
  <script setup lang="ts">
@@ -119,7 +119,7 @@ await navigateTo('https://nuxt.com', {
119
119
  ```ts [Signature]
120
120
  export function navigateTo (
121
121
  to: RouteLocationRaw | undefined | null,
122
- options?: NavigateToOptions
122
+ options?: NavigateToOptions,
123
123
  ): Promise<void | NavigationFailure | false> | false | void | RouteLocationRaw
124
124
 
125
125
  interface NavigateToOptions {
@@ -35,8 +35,8 @@ const loggedIn = computed(() => !!tokenCookie.value)
35
35
  </script>
36
36
  ```
37
37
 
38
- ::note{to="/docs/guide/going-further/experimental-features#cookiestore"}
39
- You can enable experimental `cookieStore` option to automatically refresh `useCookie` value when cookie changes in the browser.
38
+ ::note{to="/docs/3.x/guide/going-further/experimental-features#cookiestore"}
39
+ Since [Nuxt v3.12.0](https://github.com/nuxt/nuxt/releases/tag/v3.12.0), the experimental `cookieStore` option is enabled by default. It automatically refreshes the `useCookie` value when cookies change in the browser.
40
40
  ::
41
41
 
42
42
  ## Type
@@ -9,7 +9,7 @@ links:
9
9
  ---
10
10
 
11
11
  ::note
12
- Updates the [`app.config`](/docs/3.x/guide/directory-structure/app-config) using deep assignment. Existing (nested) properties will be preserved.
12
+ Updates the [`app.config`](/docs/3.x/directory-structure/app-config) using deep assignment. Existing (nested) properties will be preserved.
13
13
  ::
14
14
 
15
15
  ## Usage
@@ -39,8 +39,8 @@ The command lets you install [Nuxt modules](/modules) in your application with n
39
39
  When running the command, it will:
40
40
 
41
41
  - install the module as a dependency using your package manager
42
- - add it to your [package.json](/docs/3.x/guide/directory-structure/package) file
43
- - update your [`nuxt.config`](/docs/3.x/guide/directory-structure/nuxt-config) file
42
+ - add it to your [package.json](/docs/3.x/directory-structure/package) file
43
+ - update your [`nuxt.config`](/docs/3.x/directory-structure/nuxt-config) file
44
44
 
45
45
  **Example:**
46
46
 
@@ -14,7 +14,7 @@ npx nuxt prepare [ROOTDIR] [--dotenv] [--cwd=<directory>] [--logLevel=<silent|in
14
14
  ```
15
15
  <!--/prepare-cmd-->
16
16
 
17
- The `prepare` command creates a [`.nuxt`](/docs/3.x/guide/directory-structure/nuxt) directory in your application and generates types. This can be useful in a CI environment or as a `postinstall` command in your [`package.json`](/docs/3.x/guide/directory-structure/package).
17
+ The `prepare` command creates a [`.nuxt`](/docs/3.x/directory-structure/nuxt) directory in your application and generates types. This can be useful in a CI environment or as a `postinstall` command in your [`package.json`](/docs/3.x/directory-structure/package).
18
18
 
19
19
  ## Arguments
20
20
 
@@ -40,5 +40,5 @@ Option | Default | Description
40
40
  This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a `.env` file or as command-line argument.
41
41
 
42
42
  ::note
43
- For convenience, in preview mode, your [`.env`](/docs/3.x/guide/directory-structure/env) file will be loaded into `process.env`. (However, in production you will need to ensure your environment variables are set yourself. For example, with Node.js 20+ you could do this by running `node --env-file .env .output/server/index.mjs` to start your server.)
43
+ For convenience, in preview mode, your [`.env`](/docs/3.x/directory-structure/env) file will be loaded into `process.env`. (However, in production you will need to ensure your environment variables are set yourself. For example, with Node.js 20+ you could do this by running `node --env-file .env .output/server/index.mjs` to start your server.)
44
44
  ::
@@ -36,7 +36,7 @@ Option | Default | Description
36
36
  <!--/typecheck-opts-->
37
37
 
38
38
  ::note
39
- This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a [`.env`](/docs/3.x/guide/directory-structure/env) file or as a command-line argument.
39
+ This command sets `process.env.NODE_ENV` to `production`. To override, define `NODE_ENV` in a [`.env`](/docs/3.x/directory-structure/env) file or as a command-line argument.
40
40
  ::
41
41
 
42
42
  ::read-more{to="/docs/guide/concepts/typescript#type-checking"}
@@ -47,7 +47,7 @@ export function defineNuxtModule<TOptions extends ModuleOptions> (
47
47
 
48
48
  export function defineNuxtModule<TOptions extends ModuleOptions> (): {
49
49
  with: <TOptionsDefaults extends Partial<TOptions>> (
50
- definition: ModuleDefinition<TOptions, TOptionsDefaults, true> | NuxtModule<TOptions, TOptionsDefaults, true>
50
+ definition: ModuleDefinition<TOptions, TOptionsDefaults, true> | NuxtModule<TOptions, TOptionsDefaults, true>,
51
51
  ) => NuxtModule<TOptions, TOptionsDefaults, true>
52
52
  }
53
53
  ```
@@ -8,7 +8,7 @@ links:
8
8
  size: xs
9
9
  ---
10
10
 
11
- Programmatic usage can be helpful when you want to use Nuxt programmatically, for example, when building a [CLI tool](https://github.com/nuxt/cli) or [test utils](https://github.com/nuxt/nuxt/tree/main/packages/test-utils).
11
+ Programmatic usage can be helpful when you want to use Nuxt programmatically, for example, when building a [CLI tool](https://github.com/nuxt/cli) or [test utils](https://github.com/nuxt/test-utils).
12
12
 
13
13
  ## `loadNuxt`
14
14
 
@@ -31,7 +31,7 @@ function loadNuxt (loadOptions?: LoadNuxtOptions): Promise<Nuxt>
31
31
 
32
32
  ## `buildNuxt`
33
33
 
34
- Build Nuxt programmatically. It will invoke the builder (currently [@nuxt/vite-builder](https://github.com/nuxt/nuxt/tree/main/packages/vite) or [@nuxt/webpack-builder](https://github.com/nuxt/nuxt/tree/main/packages/webpack)) to bundle the application.
34
+ Build Nuxt programmatically. It will invoke the builder (currently [@nuxt/vite-builder](https://github.com/nuxt/nuxt/blob/main/packages/vite) or [@nuxt/webpack-builder](https://github.com/nuxt/nuxt/blob/main/packages/webpack)) to bundle the application.
35
35
 
36
36
  ### Type
37
37
 
@@ -113,7 +113,7 @@ function addComponent (options: AddComponentOptions): void
113
113
  | ------------------ | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
114
114
  | `name` | `string` | `true` | Component name. |
115
115
  | `filePath` | `string` | `true` | Path to the component. |
116
- | `declarationPath` | `string` | `false` | Path to component's declaration file. It is used to generate components' [type templates](/docs/4.x/api/kit/templates#addtypetemplate); if not provided, `filePath` is used instead. |
116
+ | `declarationPath` | `string` | `false` | Path to component's declaration file. It is used to generate components' [type templates](/docs/3.x/api/kit/templates#addtypetemplate); if not provided, `filePath` is used instead. |
117
117
  | `pascalName` | `string` | `false` | Pascal case component name. If not provided, it will be generated from the component name. |
118
118
  | `kebabName` | `string` | `false` | Kebab case component name. If not provided, it will be generated from the component name. |
119
119
  | `export` | `string` | `false` | Specify named or default export. If not provided, it will be set to `'default'`. |
@@ -46,7 +46,7 @@ Hook | Arguments | Description
46
46
  `modules:done` | - | Called during Nuxt initialization, after installing user modules.
47
47
  `app:resolve` | `app` | Called after resolving the `app` instance.
48
48
  `app:templates` | `app` | Called during `NuxtApp` generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to `.nuxt`).
49
- `app:templatesGenerated` | `app` | Called after templates are compiled into the [virtual file system](/docs/3.x/guide/directory-structure/nuxt#virtual-file-system) (vfs).
49
+ `app:templatesGenerated` | `app` | Called after templates are compiled into the [virtual file system](/docs/3.x/directory-structure/nuxt#virtual-file-system) (vfs).
50
50
  `build:before` | - | Called before Nuxt bundle builder.
51
51
  `build:done` | - | Called after Nuxt bundle builder is complete.
52
52
  `build:manifest` | `manifest` | Called during the manifest build by Vite and webpack. This allows customizing the manifest that Nitro will use to render `<script>` and `<link>` tags in the final HTML.
@@ -39,7 +39,7 @@ If your issue concerns Vue or Vite, please try to reproduce it first with the Vu
39
39
 
40
40
  ::card-group
41
41
  :card{title="Vue SSR on StackBlitz" icon="i-simple-icons-stackblitz" to="https://stackblitz.com/github/nuxt-contrib/vue3-ssr-starter/tree/main?terminal=dev" target="_blank"}
42
- :card{title="Vue SSR on CodeSandbox" icon="i-simple-icons-codesandbox" to="https://codesandbox.io/s/github/nuxt-contrib/vue3-ssr-starter/main" target="_blank"}
42
+ :card{title="Vue SSR on CodeSandbox" icon="i-simple-icons-codesandbox" to="https://codesandbox.io/p/sandbox/github/nuxt-contrib/vue3-ssr-starter/main" target="_blank"}
43
43
  :card{title="Vue SSR Template on GitHub" icon="i-simple-icons-github" to="https://github.com/nuxt-contrib/vue3-ssr-starter/generate" target="_blank"}
44
44
  ::
45
45