@nuxt/docs-nightly 4.1.3-29313386.edc02e27 → 4.1.3-29314777.50febbbb

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 (108) hide show
  1. package/1.getting-started/01.introduction.md +4 -4
  2. package/1.getting-started/02.installation.md +1 -1
  3. package/1.getting-started/03.configuration.md +6 -6
  4. package/1.getting-started/04.views.md +2 -2
  5. package/1.getting-started/05.assets.md +1 -1
  6. package/1.getting-started/06.styling.md +3 -3
  7. package/1.getting-started/07.routing.md +5 -5
  8. package/1.getting-started/08.seo-meta.md +4 -4
  9. package/1.getting-started/10.data-fetching.md +14 -14
  10. package/1.getting-started/11.state-management.md +4 -4
  11. package/1.getting-started/12.error-handling.md +11 -11
  12. package/1.getting-started/13.server.md +5 -5
  13. package/1.getting-started/14.layers.md +1 -1
  14. package/1.getting-started/15.prerendering.md +4 -4
  15. package/1.getting-started/16.deployment.md +1 -1
  16. package/1.getting-started/17.testing.md +1 -1
  17. package/1.getting-started/18.upgrade.md +2 -2
  18. package/2.guide/0.index.md +5 -5
  19. package/2.guide/1.directory-structure/0.output.md +1 -1
  20. package/2.guide/1.directory-structure/1.app/1.assets.md +1 -1
  21. package/2.guide/1.directory-structure/1.app/1.components.md +4 -4
  22. package/2.guide/1.directory-structure/1.app/1.composables.md +2 -2
  23. package/2.guide/1.directory-structure/1.app/1.layouts.md +3 -3
  24. package/2.guide/1.directory-structure/1.app/1.middleware.md +3 -3
  25. package/2.guide/1.directory-structure/1.app/1.pages.md +6 -6
  26. package/2.guide/1.directory-structure/1.app/1.utils.md +2 -2
  27. package/2.guide/1.directory-structure/1.app/3.app-config.md +1 -1
  28. package/2.guide/1.directory-structure/1.app/3.app.md +3 -3
  29. package/2.guide/1.directory-structure/1.modules.md +1 -1
  30. package/2.guide/1.directory-structure/1.server.md +2 -2
  31. package/2.guide/1.directory-structure/1.shared.md +2 -2
  32. package/2.guide/1.directory-structure/2.env.md +3 -3
  33. package/2.guide/1.directory-structure/2.nuxtrc.md +1 -1
  34. package/2.guide/1.directory-structure/3.nuxt-config.md +1 -1
  35. package/2.guide/2.concepts/1.auto-imports.md +4 -4
  36. package/2.guide/2.concepts/10.nuxt-lifecycle.md +7 -7
  37. package/2.guide/2.concepts/2.vuejs-development.md +4 -4
  38. package/2.guide/2.concepts/3.rendering.md +3 -3
  39. package/2.guide/2.concepts/4.server-engine.md +1 -1
  40. package/2.guide/2.concepts/5.modules.md +1 -1
  41. package/2.guide/2.concepts/7.esm.md +2 -2
  42. package/2.guide/3.going-further/1.events.md +1 -1
  43. package/2.guide/3.going-further/1.experimental-features.md +4 -4
  44. package/2.guide/3.going-further/10.runtime-config.md +1 -1
  45. package/2.guide/3.going-further/11.nightly-release-channel.md +1 -1
  46. package/2.guide/3.going-further/2.hooks.md +3 -3
  47. package/2.guide/3.going-further/3.modules.md +7 -7
  48. package/2.guide/3.going-further/4.kit.md +2 -2
  49. package/2.guide/3.going-further/6.nuxt-app.md +3 -3
  50. package/2.guide/3.going-further/7.layers.md +1 -1
  51. package/2.guide/4.recipes/3.custom-usefetch.md +1 -1
  52. package/2.guide/4.recipes/4.sessions-and-authentication.md +1 -1
  53. package/2.guide/5.best-practices/performance.md +5 -5
  54. package/3.api/1.components/1.nuxt-client-fallback.md +1 -1
  55. package/3.api/1.components/11.teleports.md +1 -1
  56. package/3.api/1.components/2.nuxt-page.md +2 -2
  57. package/3.api/1.components/3.nuxt-layout.md +4 -4
  58. package/3.api/1.components/4.nuxt-link.md +2 -2
  59. package/3.api/1.components/5.nuxt-loading-indicator.md +1 -1
  60. package/3.api/1.components/6.nuxt-error-boundary.md +1 -1
  61. package/3.api/2.composables/use-app-config.md +1 -1
  62. package/3.api/2.composables/use-async-data.md +3 -3
  63. package/3.api/2.composables/use-cookie.md +1 -1
  64. package/3.api/2.composables/use-error.md +1 -1
  65. package/3.api/2.composables/use-fetch.md +4 -4
  66. package/3.api/2.composables/use-head.md +1 -1
  67. package/3.api/2.composables/use-lazy-async-data.md +2 -2
  68. package/3.api/2.composables/use-lazy-fetch.md +2 -2
  69. package/3.api/2.composables/use-nuxt-app.md +1 -1
  70. package/3.api/2.composables/use-router.md +1 -1
  71. package/3.api/2.composables/use-runtime-config.md +5 -5
  72. package/3.api/2.composables/use-seo-meta.md +2 -2
  73. package/3.api/2.composables/use-server-seo-meta.md +2 -2
  74. package/3.api/2.composables/use-state.md +1 -1
  75. package/3.api/3.utils/$fetch.md +1 -1
  76. package/3.api/3.utils/call-once.md +2 -2
  77. package/3.api/3.utils/clear-error.md +1 -1
  78. package/3.api/3.utils/create-error.md +1 -1
  79. package/3.api/3.utils/define-nuxt-plugin.md +1 -1
  80. package/3.api/3.utils/define-page-meta.md +2 -2
  81. package/3.api/3.utils/define-route-rules.md +2 -2
  82. package/3.api/3.utils/navigate-to.md +1 -1
  83. package/3.api/3.utils/preload-route-components.md +2 -2
  84. package/3.api/3.utils/refresh-cookie.md +1 -1
  85. package/3.api/3.utils/refresh-nuxt-data.md +1 -1
  86. package/3.api/3.utils/reload-nuxt-app.md +1 -1
  87. package/3.api/3.utils/set-response-status.md +1 -1
  88. package/3.api/3.utils/show-error.md +1 -1
  89. package/3.api/3.utils/update-app-config.md +1 -1
  90. package/3.api/4.commands/generate.md +1 -1
  91. package/3.api/4.commands/typecheck.md +1 -1
  92. package/3.api/6.advanced/1.hooks.md +1 -1
  93. package/3.api/6.nuxt-config.md +6 -6
  94. package/3.api/index.md +7 -7
  95. package/5.community/4.contribution.md +5 -5
  96. package/5.community/5.framework-contribution.md +1 -1
  97. package/6.bridge/3.bridge-composition-api.md +2 -2
  98. package/6.bridge/5.nuxt3-compatible-api.md +1 -1
  99. package/7.migration/10.bundling.md +1 -1
  100. package/7.migration/11.server.md +3 -3
  101. package/7.migration/2.configuration.md +1 -1
  102. package/7.migration/20.module-authors.md +1 -1
  103. package/7.migration/4.meta.md +1 -1
  104. package/7.migration/5.plugins-and-middleware.md +3 -3
  105. package/7.migration/6.pages-and-layouts.md +5 -5
  106. package/7.migration/7.component-options.md +4 -4
  107. package/7.migration/8.runtime-config.md +1 -1
  108. package/package.json +1 -1
@@ -44,7 +44,7 @@ Overall, server-side rendering can provide a faster and more efficient user expe
44
44
  As Nuxt is a versatile framework, it gives you the possibility to statically render your whole application to a static hosting with `nuxt generate`,
45
45
  disable SSR globally with the `ssr: false` option or leverage hybrid rendering by setting up the `routeRules` option.
46
46
 
47
- :read-more{title="Nuxt rendering modes" to="/docs/guide/concepts/rendering"}
47
+ :read-more{title="Nuxt rendering modes" to="/docs/4.x/guide/concepts/rendering"}
48
48
 
49
49
  ### Server engine
50
50
 
@@ -54,19 +54,19 @@ In development, it uses Rollup and Node.js workers for your server code and cont
54
54
 
55
55
  In production, Nitro builds your app and server into one universal `.output` directory. This output is light: minified and removed from any Node.js modules (except polyfills). You can deploy this output on any system supporting JavaScript, from Node.js, Serverless, Workers, Edge-side rendering or purely static.
56
56
 
57
- :read-more{title="Nuxt server engine" to="/docs/guide/concepts/server-engine"}
57
+ :read-more{title="Nuxt server engine" to="/docs/4.x/guide/concepts/server-engine"}
58
58
 
59
59
  ### Production-ready
60
60
 
61
61
  A Nuxt application can be deployed on a Node or Deno server, pre-rendered to be hosted in static environments, or deployed to serverless and edge providers.
62
62
 
63
- :read-more{title="Deployment section" to="/docs/getting-started/deployment"}
63
+ :read-more{title="Deployment section" to="/docs/4.x/getting-started/deployment"}
64
64
 
65
65
  ### Modular
66
66
 
67
67
  A module system allows you to extend Nuxt with custom features and integrations with third-party services.
68
68
 
69
- :read-more{title="Nuxt Modules Concept" to="/docs/guide/concepts/modules"}
69
+ :read-more{title="Nuxt Modules Concept" to="/docs/4.x/guide/concepts/modules"}
70
70
 
71
71
  ### Architecture
72
72
 
@@ -115,4 +115,4 @@ Well done! A browser window should automatically open for <http://localhost:3000
115
115
 
116
116
  Now that you've created your Nuxt project, you are ready to start building your application.
117
117
 
118
- :read-more{title="Nuxt Concepts" to="/docs/guide/concepts"}
118
+ :read-more{title="Nuxt Concepts" to="/docs/4.x/guide/concepts"}
@@ -20,7 +20,7 @@ export default defineNuxtConfig({
20
20
 
21
21
  This file will often be mentioned in the documentation, for example to add custom scripts, register modules or change rendering modes.
22
22
 
23
- ::read-more{to="/docs/api/configuration/nuxt-config"}
23
+ ::read-more{to="/docs/4.x/api/configuration/nuxt-config"}
24
24
  Every option is described in the **Configuration Reference**.
25
25
  ::
26
26
 
@@ -96,7 +96,7 @@ const runtimeConfig = useRuntimeConfig()
96
96
  </script>
97
97
  ```
98
98
 
99
- :read-more{to="/docs/guide/going-further/runtime-config"}
99
+ :read-more{to="/docs/4.x/guide/going-further/runtime-config"}
100
100
 
101
101
  ## App Configuration
102
102
 
@@ -124,7 +124,7 @@ const appConfig = useAppConfig()
124
124
  </script>
125
125
  ```
126
126
 
127
- :read-more{to="/docs/guide/directory-structure/app-config"}
127
+ :read-more{to="/docs/4.x/guide/directory-structure/app-config"}
128
128
 
129
129
  ## `runtimeConfig` vs. `app.config`
130
130
 
@@ -187,7 +187,7 @@ export default defineNuxtConfig({
187
187
  })
188
188
  ```
189
189
 
190
- :read-more{to="/docs/api/configuration/nuxt-config#vue"}
190
+ :read-more{to="/docs/4.x/api/configuration/nuxt-config#vue"}
191
191
 
192
192
  ### With webpack
193
193
 
@@ -205,7 +205,7 @@ export default defineNuxtConfig({
205
205
  })
206
206
  ```
207
207
 
208
- :read-more{to="/docs/api/configuration/nuxt-config#loaders"}
208
+ :read-more{to="/docs/4.x/api/configuration/nuxt-config#loaders"}
209
209
 
210
210
  ### Enabling Experimental Vue Features
211
211
 
@@ -223,4 +223,4 @@ export default defineNuxtConfig({
223
223
 
224
224
  Since Nuxt 3.9 and Vue 3.4, `reactivityTransform` has been moved from Vue to Vue Macros which has a [Nuxt integration](https://vue-macros.dev/guide/nuxt-integration.html).
225
225
 
226
- :read-more{to="/docs/api/configuration/nuxt-config#vue-1"}
226
+ :read-more{to="/docs/4.x/api/configuration/nuxt-config#vue-1"}
@@ -82,7 +82,7 @@ To use pages, create an `app/pages/index.vue` file and add `<NuxtPage />` compon
82
82
 
83
83
  ::
84
84
 
85
- :read-more{title="Routing Section" to="/docs/getting-started/routing"}
85
+ :read-more{title="Routing Section" to="/docs/4.x/getting-started/routing"}
86
86
 
87
87
  ## Layouts
88
88
 
@@ -162,4 +162,4 @@ export default defineNitroPlugin((nitroApp) => {
162
162
  })
163
163
  ```
164
164
 
165
- :read-more{to="/docs/guide/going-further/hooks"}
165
+ :read-more{to="/docs/4.x/guide/going-further/hooks"}
@@ -44,5 +44,5 @@ For example, referencing an image file that will be processed if a build tool is
44
44
  ```
45
45
 
46
46
  ::note
47
- Nuxt won't serve files in the [`app/assets/`](/docs/4.x/guide/directory-structure/app/assets) directory at a static URL like `/assets/my-file.png`. If you need a static URL, use the [`public/`](/docs/getting-started/assets#public-directory) directory.
47
+ Nuxt won't serve files in the [`app/assets/`](/docs/4.x/guide/directory-structure/app/assets) directory at a static URL like `/assets/my-file.png`. If you need a static URL, use the [`public/`](/docs/4.x/getting-started/assets#public-directory) directory.
48
48
  ::
@@ -137,7 +137,7 @@ export default defineNuxtConfig({
137
137
 
138
138
  You can use the useHead composable to dynamically set a value in your head in your code.
139
139
 
140
- :read-more{to="/docs/api/composables/use-head"}
140
+ :read-more{to="/docs/4.x/api/composables/use-head"}
141
141
 
142
142
  ```ts twoslash
143
143
  useHead({
@@ -492,7 +492,7 @@ Use different styles for different layouts.
492
492
  </style>
493
493
  ```
494
494
 
495
- :read-more{to="/docs/guide/directory-structure/app/layouts"}
495
+ :read-more{to="/docs/4.x/guide/directory-structure/app/layouts"}
496
496
 
497
497
  ## Third Party Libraries And Modules
498
498
 
@@ -523,7 +523,7 @@ If you are using [UnoCSS](https://unocss.dev/integrations/nuxt), note that it co
523
523
 
524
524
  Nuxt comes with the same `<Transition>` element that Vue has, and also has support for the experimental [View Transitions API](/docs/4.x/getting-started/transitions#view-transitions-api-experimental).
525
525
 
526
- :read-more{to="/docs/getting-started/transitions"}
526
+ :read-more{to="/docs/4.x/getting-started/transitions"}
527
527
 
528
528
  ### Font Advanced Optimization
529
529
 
@@ -43,7 +43,7 @@ This file system routing uses naming conventions to create dynamic and nested ro
43
43
 
44
44
  ::
45
45
 
46
- :read-more{to="/docs/guide/directory-structure/app/pages"}
46
+ :read-more{to="/docs/4.x/guide/directory-structure/app/pages"}
47
47
 
48
48
  ## Navigation
49
49
 
@@ -65,7 +65,7 @@ When a [`<NuxtLink>`](/docs/4.x/api/components/nuxt-link) enters the viewport on
65
65
  </template>
66
66
  ```
67
67
 
68
- :read-more{to="/docs/api/components/nuxt-link"}
68
+ :read-more{to="/docs/4.x/api/components/nuxt-link"}
69
69
 
70
70
  ## Route Parameters
71
71
 
@@ -80,7 +80,7 @@ console.log(route.params.id)
80
80
  </script>
81
81
  ```
82
82
 
83
- :read-more{to="/docs/api/composables/use-route"}
83
+ :read-more{to="/docs/4.x/api/composables/use-route"}
84
84
 
85
85
  ## Route Middleware
86
86
 
@@ -125,7 +125,7 @@ definePageMeta({
125
125
 
126
126
  ::
127
127
 
128
- :read-more{to="/docs/guide/directory-structure/app/middleware"}
128
+ :read-more{to="/docs/4.x/guide/directory-structure/app/middleware"}
129
129
 
130
130
  ## Route Validation
131
131
 
@@ -146,4 +146,4 @@ definePageMeta({
146
146
  </script>
147
147
  ```
148
148
 
149
- :read-more{to="/docs/api/utils/define-page-meta"}
149
+ :read-more{to="/docs/4.x/api/utils/define-page-meta"}
@@ -33,7 +33,7 @@ export default defineNuxtConfig({
33
33
  })
34
34
  ```
35
35
 
36
- You can also provide any of the keys listed below in [Types](/docs/getting-started/seo-meta#types).
36
+ You can also provide any of the keys listed below in [Types](/docs/4.x/getting-started/seo-meta#types).
37
37
 
38
38
  ### Defaults Tags
39
39
 
@@ -96,7 +96,7 @@ useSeoMeta({
96
96
  </script>
97
97
  ```
98
98
 
99
- :read-more{to="/docs/api/composables/use-seo-meta"}
99
+ :read-more{to="/docs/4.x/api/composables/use-seo-meta"}
100
100
 
101
101
  ## Components
102
102
 
@@ -291,9 +291,9 @@ useHead({
291
291
  </script>
292
292
  ```
293
293
 
294
- :link-example{to="/docs/examples/features/meta-tags"}
294
+ :link-example{to="/docs/4.x/examples/features/meta-tags"}
295
295
 
296
- :read-more{to="/docs/guide/directory-structure/app/pages/#page-metadata"}
296
+ :read-more{to="/docs/4.x/guide/directory-structure/app/pages/#page-metadata"}
297
297
 
298
298
  ### Dynamic Title
299
299
 
@@ -80,11 +80,11 @@ async function addTodo() {
80
80
  ```
81
81
 
82
82
  ::warning
83
- Beware that using only `$fetch` will not provide [network calls de-duplication and navigation prevention](/docs/getting-started/data-fetching#the-need-for-usefetch-and-useasyncdata). :br
84
- It is recommended to use `$fetch` for client-side interactions (event-based) or combined with [`useAsyncData`](/docs/getting-started/data-fetching#useasyncdata) when fetching the initial component data.
83
+ Beware that using only `$fetch` will not provide [network calls de-duplication and navigation prevention](/docs/4.x/getting-started/data-fetching#the-need-for-usefetch-and-useasyncdata). :br
84
+ It is recommended to use `$fetch` for client-side interactions (event-based) or combined with [`useAsyncData`](/docs/4.x/getting-started/data-fetching#useasyncdata) when fetching the initial component data.
85
85
  ::
86
86
 
87
- ::read-more{to="/docs/api/utils/dollarfetch"}
87
+ ::read-more{to="/docs/4.x/api/utils/dollarfetch"}
88
88
  Read more about `$fetch`.
89
89
  ::
90
90
 
@@ -146,9 +146,9 @@ This composable is a wrapper around the [`useAsyncData`](/docs/4.x/api/composabl
146
146
 
147
147
  :video-accordion{title="Watch a video from Alexander Lichter to avoid using useFetch the wrong way" videoId="njsGVmcWviY"}
148
148
 
149
- :read-more{to="/docs/api/composables/use-fetch"}
149
+ :read-more{to="/docs/4.x/api/composables/use-fetch"}
150
150
 
151
- :link-example{to="/docs/examples/features/data-fetching"}
151
+ :link-example{to="/docs/4.x/examples/features/data-fetching"}
152
152
 
153
153
  ## `useAsyncData`
154
154
 
@@ -220,7 +220,7 @@ await useAsyncData(() => offersStore.getOffer(route.params.slug))
220
220
  ```
221
221
  ::
222
222
 
223
- ::read-more{to="/docs/api/composables/use-async-data"}
223
+ ::read-more{to="/docs/4.x/api/composables/use-async-data"}
224
224
  Read more about `useAsyncData`.
225
225
  ::
226
226
 
@@ -280,11 +280,11 @@ const { status, data: posts } = useLazyFetch('/api/posts')
280
280
  </script>
281
281
  ```
282
282
 
283
- ::read-more{to="/docs/api/composables/use-lazy-fetch"}
283
+ ::read-more{to="/docs/4.x/api/composables/use-lazy-fetch"}
284
284
  Read more about `useLazyFetch`.
285
285
  ::
286
286
 
287
- ::read-more{to="/docs/api/composables/use-lazy-async-data"}
287
+ ::read-more{to="/docs/4.x/api/composables/use-lazy-async-data"}
288
288
  Read more about `useLazyAsyncData`.
289
289
  ::
290
290
 
@@ -307,7 +307,7 @@ const { status, data: comments } = useFetch('/api/comments', {
307
307
  })
308
308
  ```
309
309
 
310
- The `useFetch` composable is meant to be invoked in setup method or called directly at the top level of a function in lifecycle hooks, otherwise you should use [`$fetch` method](/docs/getting-started/data-fetching#fetch).
310
+ The `useFetch` composable is meant to be invoked in setup method or called directly at the top level of a function in lifecycle hooks, otherwise you should use [`$fetch` method](/docs/4.x/getting-started/data-fetching#fetch).
311
311
 
312
312
  ### Minimize payload size
313
313
 
@@ -431,7 +431,7 @@ const { data, error, execute, refresh } = await useFetch('/api/users')
431
431
  </template>
432
432
  ```
433
433
 
434
- The `execute` function is an alias for `refresh` that works in exactly the same way but is more semantic for cases when the fetch is [not immediate](/docs/getting-started/data-fetching#not-immediate).
434
+ The `execute` function is an alias for `refresh` that works in exactly the same way but is more semantic for cases when the fetch is [not immediate](/docs/4.x/getting-started/data-fetching#not-immediate).
435
435
 
436
436
  ::tip
437
437
  To globally refetch or invalidate cached data, see [`clearNuxtData`](/docs/4.x/api/utils/clear-nuxt-data) and [`refreshNuxtData`](/docs/4.x/api/utils/refresh-nuxt-data).
@@ -479,7 +479,7 @@ const { data, error, refresh } = await useFetch(`/api/users/${id.value}`, {
479
479
  </script>
480
480
  ```
481
481
 
482
- If you need to change the URL based on a reactive value, you may want to use a [computed URL](/docs/getting-started/data-fetching#computed-url) instead.
482
+ If you need to change the URL based on a reactive value, you may want to use a [computed URL](/docs/4.x/getting-started/data-fetching#computed-url) instead.
483
483
 
484
484
  When reactive fetch options are provided, they'll be automatically watched and trigger refetches. In some cases, it can be useful to opt-out of this behavior by specifying `watch: false`.
485
485
 
@@ -514,7 +514,7 @@ const { data, status } = useLazyFetch('/api/user', {
514
514
 
515
515
  In the case of more complex URL construction, you may use a callback as a [computed getter](https://vuejs.org/guide/essentials/computed.html) that returns the URL string.
516
516
 
517
- Every time a dependency changes, the data will be fetched using the newly constructed URL. Combine this with [not-immediate](/docs/getting-started/data-fetching#not-immediate), and you can wait until the reactive element changes before fetching.
517
+ Every time a dependency changes, the data will be fetched using the newly constructed URL. Combine this with [not-immediate](/docs/4.x/getting-started/data-fetching#not-immediate), and you can wait until the reactive element changes before fetching.
518
518
 
519
519
  ```vue
520
520
  <script setup lang="ts">
@@ -547,7 +547,7 @@ const pending = computed(() => status.value === 'pending');
547
547
  </template>
548
548
  ```
549
549
 
550
- If you need to force a refresh when other reactive values change, you can also [watch other values](/docs/getting-started/data-fetching#watch).
550
+ If you need to force a refresh when other reactive values change, you can also [watch other values](/docs/4.x/getting-started/data-fetching#watch).
551
551
 
552
552
  ### Not immediate
553
553
 
@@ -647,7 +647,7 @@ export default defineNuxtComponent({
647
647
  Using `<script setup>` or `<script setup lang="ts">` are the recommended way of declaring Vue components in Nuxt.
648
648
  ::
649
649
 
650
- :read-more{to="/docs/api/utils/define-nuxt-component"}
650
+ :read-more{to="/docs/4.x/api/utils/define-nuxt-component"}
651
651
 
652
652
  ## Serializing Data From Server to Client
653
653
 
@@ -14,7 +14,7 @@ Nuxt provides the [`useState`](/docs/4.x/api/composables/use-state) composable t
14
14
  Because the data inside [`useState`](/docs/4.x/api/composables/use-state) will be serialized to JSON, it is important that it does not contain anything that cannot be serialized, such as classes, functions or symbols.
15
15
  ::
16
16
 
17
- ::read-more{to="/docs/api/composables/use-state"}
17
+ ::read-more{to="/docs/4.x/api/composables/use-state"}
18
18
  Read more about `useState` composable.
19
19
  ::
20
20
 
@@ -53,7 +53,7 @@ const counter = useState('counter', () => Math.round(Math.random() * 1000))
53
53
  </template>
54
54
  ```
55
55
 
56
- :link-example{to="/docs/examples/features/state-management"}
56
+ :link-example{to="/docs/4.x/examples/features/state-management"}
57
57
 
58
58
  ::note
59
59
  To globally invalidate cached state, see [`clearNuxtState`](/docs/4.x/api/utils/clear-nuxt-state) util.
@@ -77,7 +77,7 @@ await callOnce(async () => {
77
77
  This is similar to the [`nuxtServerInit` action](https://v2.nuxt.com/docs/directory-structure/store/#the-nuxtserverinit-action) in Nuxt 2, which allows filling the initial state of your store server-side before rendering the page.
78
78
  ::
79
79
 
80
- :read-more{to="/docs/api/utils/call-once"}
80
+ :read-more{to="/docs/4.x/api/utils/call-once"}
81
81
 
82
82
  ### Usage with Pinia
83
83
 
@@ -187,7 +187,7 @@ const date = useLocaleDate(new Date('2016-10-26'))
187
187
  ```
188
188
  ::
189
189
 
190
- :link-example{to="/docs/examples/advanced/locale"}
190
+ :link-example{to="/docs/4.x/examples/advanced/locale"}
191
191
 
192
192
  ## Shared State
193
193
 
@@ -53,7 +53,7 @@ This includes:
53
53
 
54
54
  ## Nitro Server Errors
55
55
 
56
- You cannot currently define a server-side handler for these errors, but can render an error page, see the [Render an Error Page](/docs/getting-started/error-handling#error-page) section.
56
+ You cannot currently define a server-side handler for these errors, but can render an error page, see the [Render an Error Page](/docs/4.x/getting-started/error-handling#error-page) section.
57
57
 
58
58
  ## Errors with JS Chunks
59
59
 
@@ -78,7 +78,7 @@ It can also occur on the client side when:
78
78
  - mounting your app if the error was not handled with `onErrorCaptured` or `vue:error` hook
79
79
  - the Vue app is initialized and mounted in browser (`app:mounted`).
80
80
 
81
- ::read-more{to="/docs/api/advanced/hooks"}
81
+ ::read-more{to="/docs/4.x/api/advanced/hooks"}
82
82
  Discover all the Nuxt lifecycle hooks.
83
83
  ::
84
84
 
@@ -105,7 +105,7 @@ const handleError = () => clearError({ redirect: '/' })
105
105
  </template>
106
106
  ```
107
107
 
108
- ::read-more{to="/docs/guide/directory-structure/error"}
108
+ ::read-more{to="/docs/4.x/guide/directory-structure/error"}
109
109
  Read more about `error.vue` and its uses.
110
110
  ::
111
111
 
@@ -126,7 +126,7 @@ Make sure to check before using anything dependent on Nuxt plugins, such as `$ro
126
126
  ::
127
127
 
128
128
  ::note
129
- Rendering an error page is an entirely separate page load, meaning any registered middleware will run again. You can use [`useError`](/docs/getting-started/error-handling#useerror) in middleware to check if an error is being handled.
129
+ Rendering an error page is an entirely separate page load, meaning any registered middleware will run again. You can use [`useError`](/docs/4.x/getting-started/error-handling#useerror) in middleware to check if an error is being handled.
130
130
  ::
131
131
 
132
132
  ::note
@@ -143,7 +143,7 @@ function useError (): Ref<Error | { url, statusCode, statusMessage, message, des
143
143
 
144
144
  This function will return the global Nuxt error that is being handled.
145
145
 
146
- ::read-more{to="/docs/api/composables/use-error"}
146
+ ::read-more{to="/docs/4.x/api/composables/use-error"}
147
147
  Read more about `useError` composable.
148
148
  ::
149
149
 
@@ -156,7 +156,7 @@ function createError (err: string | { cause, data, message, name, stack, statusC
156
156
  Create an error object with additional metadata. You can pass a string to be set as the error `message` or an object containing error properties. It is usable in both the Vue and Server portions of your app, and is meant to be thrown.
157
157
 
158
158
  If you throw an error created with `createError`:
159
- - on server-side, it will trigger a full-screen error page which you can clear with [`clearError`](/docs/getting-started/error-handling#clearerror).
159
+ - on server-side, it will trigger a full-screen error page which you can clear with [`clearError`](/docs/4.x/getting-started/error-handling#clearerror).
160
160
  - on client-side, it will throw a non-fatal error for you to handle. If you need to trigger a full-screen error page, then you can do this by setting `fatal: true`.
161
161
 
162
162
  ```vue twoslash [pages/movies/[slug\\].vue]
@@ -173,7 +173,7 @@ if (!data.value) {
173
173
  </script>
174
174
  ```
175
175
 
176
- ::read-more{to="/docs/api/utils/create-error"}
176
+ ::read-more{to="/docs/4.x/api/utils/create-error"}
177
177
  Read more about `createError` util.
178
178
  ::
179
179
 
@@ -183,11 +183,11 @@ Read more about `createError` util.
183
183
  function showError (err: string | Error | { statusCode, statusMessage }): Error
184
184
  ```
185
185
 
186
- You can call this function at any point on client-side, or (on server side) directly within middleware, plugins or `setup()` functions. It will trigger a full-screen error page which you can clear with [`clearError`](/docs/getting-started/error-handling#clearerror).
186
+ You can call this function at any point on client-side, or (on server side) directly within middleware, plugins or `setup()` functions. It will trigger a full-screen error page which you can clear with [`clearError`](/docs/4.x/getting-started/error-handling#clearerror).
187
187
 
188
188
  It is recommended instead to use `throw createError()`.
189
189
 
190
- ::read-more{to="/docs/api/utils/show-error"}
190
+ ::read-more{to="/docs/4.x/api/utils/show-error"}
191
191
  Read more about `showError` util.
192
192
  ::
193
193
 
@@ -199,7 +199,7 @@ function clearError (options?: { redirect?: string }): Promise<void>
199
199
 
200
200
  This function will clear the currently handled Nuxt error. It also takes an optional path to redirect to (for example, if you want to navigate to a 'safe' page).
201
201
 
202
- ::read-more{to="/docs/api/utils/clear-error"}
202
+ ::read-more{to="/docs/4.x/api/utils/clear-error"}
203
203
  Read more about `clearError` util.
204
204
  ::
205
205
 
@@ -230,4 +230,4 @@ If you navigate to another route, the error will be cleared automatically.
230
230
  </template>
231
231
  ```
232
232
 
233
- :link-example{to="/docs/examples/advanced/error-handling"}
233
+ :link-example{to="/docs/4.x/examples/advanced/error-handling"}
@@ -4,7 +4,7 @@ description: Build full-stack applications with Nuxt's server framework. You can
4
4
  navigation.icon: i-lucide-pc-case
5
5
  ---
6
6
 
7
- :read-more{to="/docs/guide/directory-structure/server"}
7
+ :read-more{to="/docs/4.x/guide/directory-structure/server"}
8
8
 
9
9
  ## Powered by Nitro
10
10
 
@@ -38,7 +38,7 @@ And you can directly return `text`, `json`, `html` or even a `stream`.
38
38
 
39
39
  Out-of-the-box, it supports **hot module replacement** and **auto-import** like the other parts of your Nuxt application.
40
40
 
41
- :read-more{to="/docs/guide/directory-structure/server"}
41
+ :read-more{to="/docs/4.x/guide/directory-structure/server"}
42
42
 
43
43
  ## Universal Deployment
44
44
 
@@ -59,7 +59,7 @@ Or for other runtimes:
59
59
  :card{icon="i-logos-bun" title="Bun" to="https://bun.sh" target="_blank"}
60
60
  ::
61
61
 
62
- :read-more{to="/docs/getting-started/deployment"}
62
+ :read-more{to="/docs/4.x/getting-started/deployment"}
63
63
 
64
64
  ## Hybrid Rendering
65
65
 
@@ -81,7 +81,7 @@ export default defineNuxtConfig({
81
81
  })
82
82
  ```
83
83
 
84
- ::read-more{to="/docs/guide/concepts/rendering#hybrid-rendering"}
84
+ ::read-more{to="/docs/4.x/guide/concepts/rendering#hybrid-rendering"}
85
85
  Learn about all available route rules are available to customize the rendering mode of your routes.
86
86
  ::
87
87
 
@@ -91,4 +91,4 @@ Some route rules (`appMiddleware`, `redirect` and `prerender`) also affect clien
91
91
 
92
92
  Nitro is used to build the app for server side rendering, as well as pre-rendering.
93
93
 
94
- :read-more{to="/docs/guide/concepts/rendering"}
94
+ :read-more{to="/docs/4.x/guide/concepts/rendering"}
@@ -96,7 +96,7 @@ export default defineNuxtConfig({
96
96
 
97
97
  This means if multiple layers define the same component, configuration, or file, the one with higher priority will be used.
98
98
 
99
- ::read-more{to="/docs/guide/going-further/layers"}
99
+ ::read-more{to="/docs/4.x/guide/going-further/layers"}
100
100
  Read more about layers in the **Layer Author Guide**.
101
101
  ::
102
102
 
@@ -6,7 +6,7 @@ navigation.icon: i-lucide-file-code-2
6
6
 
7
7
  Nuxt allows for select pages from your application to be rendered at build time. Nuxt will serve the prebuilt pages when requested instead of generating them on the fly.
8
8
 
9
- :read-more{title="Nuxt rendering modes" to="/docs/guide/concepts/rendering"}
9
+ :read-more{title="Nuxt rendering modes" to="/docs/4.x/guide/concepts/rendering"}
10
10
 
11
11
  ## Crawl-based Pre-rendering
12
12
 
@@ -45,7 +45,7 @@ Working of the Nitro crawler:
45
45
 
46
46
  This is important to understand since pages that are not linked to a discoverable page can't be pre-rendered automatically.
47
47
 
48
- ::read-more{to="/docs/api/commands/generate#nuxt-generate"}
48
+ ::read-more{to="/docs/4.x/api/commands/generate#nuxt-generate"}
49
49
  Read more about the `nuxt generate` command.
50
50
  ::
51
51
 
@@ -105,7 +105,7 @@ Read more about Nitro's `routeRules` configuration.
105
105
 
106
106
  As a shorthand, you can also configure this in a page file using [`defineRouteRules`](/docs/4.x/api/utils/define-route-rules).
107
107
 
108
- ::read-more{to="/docs/guide/going-further/experimental-features#inlinerouterules" icon="i-lucide-star"}
108
+ ::read-more{to="/docs/4.x/guide/going-further/experimental-features#inlinerouterules" icon="i-lucide-star"}
109
109
  This feature is experimental and in order to use it you must enable the `experimental.inlineRouteRules` option in your `nuxt.config`.
110
110
  ::
111
111
 
@@ -154,7 +154,7 @@ prerenderRoutes("/api/content/article/my-article");
154
154
  </template>
155
155
  ```
156
156
 
157
- :read-more{title="prerenderRoutes" to="/docs/api/utils/prerender-routes"}
157
+ :read-more{title="prerenderRoutes" to="/docs/4.x/api/utils/prerender-routes"}
158
158
 
159
159
  ### `prerender:routes` Nuxt hook
160
160
 
@@ -73,7 +73,7 @@ There are two ways to deploy a Nuxt application to any static hosting services:
73
73
  - Static site generation (SSG) with `ssr: true` pre-renders routes of your application at build time. (This is the default behavior when running `nuxt generate`.) It will also generate `/200.html` and `/404.html` single-page app fallback pages, which can render dynamic routes or 404 errors on the client (though you may need to configure this on your static host).
74
74
  - Alternatively, you can prerender your site with `ssr: false` (static single-page app). This will produce HTML pages with an empty `<div id="__nuxt"></div>` where your Vue app would normally be rendered. You will lose many SEO benefits of prerendering your site, so it is suggested instead to use [`<ClientOnly>`](/docs/4.x/api/components/client-only) to wrap the portions of your site that cannot be server rendered (if any).
75
75
 
76
- :read-more{title="Nuxt prerendering" to="/docs/getting-started/prerendering"}
76
+ :read-more{title="Nuxt prerendering" to="/docs/4.x/getting-started/prerendering"}
77
77
 
78
78
  ### Client-side Only Rendering
79
79
 
@@ -624,7 +624,7 @@ Please use the options below for the `setup` method.
624
624
  - Type: `number | undefined`
625
625
  - Default: `undefined`
626
626
 
627
- - `host`: If provided, a URL to use as the test target instead of building and running a new server. Useful for running "real" end-to-end tests against a deployed version of your application, or against an already running local server (which may provide a significant reduction in test execution timings). See the [target host end-to-end example below](/docs/getting-started/testing#target-host-end-to-end-example).
627
+ - `host`: If provided, a URL to use as the test target instead of building and running a new server. Useful for running "real" end-to-end tests against a deployed version of your application, or against an already running local server (which may provide a significant reduction in test execution timings). See the [target host end-to-end example below](/docs/4.x/getting-started/testing#target-host-end-to-end-example).
628
628
  - Type: `string`
629
629
  - Default: `undefined`
630
630
 
@@ -1195,7 +1195,7 @@ Static sites | ✅ | ✅ | ✅
1195
1195
 
1196
1196
  The migration guide provides a step-by-step comparison of Nuxt 2 features to Nuxt 3+ features and guidance to adapt your current application.
1197
1197
 
1198
- ::read-more{to="/docs/migration/overview"}
1198
+ ::read-more{to="/docs/4.x/migration/overview"}
1199
1199
  Check out the **guide to migrating from Nuxt 2 to Nuxt 3**.
1200
1200
  ::
1201
1201
 
@@ -1203,6 +1203,6 @@ Check out the **guide to migrating from Nuxt 2 to Nuxt 3**.
1203
1203
 
1204
1204
  If you prefer to progressively migrate your Nuxt 2 application to Nuxt 3, you can use Nuxt Bridge. Nuxt Bridge is a compatibility layer that allows you to use Nuxt 3+ features in Nuxt 2 with an opt-in mechanism.
1205
1205
 
1206
- ::read-more{to="/docs/bridge/overview"}
1206
+ ::read-more{to="/docs/4.x/bridge/overview"}
1207
1207
  **Migrate from Nuxt 2 to Nuxt Bridge**
1208
1208
  ::
@@ -7,19 +7,19 @@ surround: false
7
7
  ---
8
8
 
9
9
  ::card-group{class="sm:grid-cols-1"}
10
- ::card{icon="i-lucide-folders" title="Directory Structure" to="/docs/guide/directory-structure"}
10
+ ::card{icon="i-lucide-folders" title="Directory Structure" to="/docs/4.x/guide/directory-structure"}
11
11
  Learn about Nuxt directory structure and what benefits each directory or file offers.
12
12
  ::
13
- ::card{icon="i-lucide-medal" title="Key Concepts" to="/docs/guide/concepts"}
13
+ ::card{icon="i-lucide-medal" title="Key Concepts" to="/docs/4.x/guide/concepts"}
14
14
  Discover the main concepts behind Nuxt, from auto-import, hybrid rendering to its TypeScript support.
15
15
  ::
16
- ::card{icon="i-lucide-star" title="Going Further" to="/docs/guide/going-further"}
16
+ ::card{icon="i-lucide-star" title="Going Further" to="/docs/4.x/guide/going-further"}
17
17
  Master Nuxt with advanced concepts like experimental features, hooks, modules, and more.
18
18
  ::
19
- ::card{icon="i-lucide-book-open" title="Recipes" to="/docs/guide/recipes"}
19
+ ::card{icon="i-lucide-book-open" title="Recipes" to="/docs/4.x/guide/recipes"}
20
20
  Find solutions to common problems and learn how to implement them in your Nuxt project.
21
21
  ::
22
- ::card{icon="i-lucide-square-check" title="Best Practices" to="/docs/guide/best-practices"}
22
+ ::card{icon="i-lucide-square-check" title="Best Practices" to="/docs/4.x/guide/best-practices"}
23
23
  Learn about best practices when developing with Nuxt
24
24
  ::
25
25
  ::
@@ -11,7 +11,7 @@ This directory should be added to your [`.gitignore`](/docs/4.x/guide/directory-
11
11
 
12
12
  Use this directory to deploy your Nuxt application to production.
13
13
 
14
- :read-more{to="/docs/getting-started/deployment"}
14
+ :read-more{to="/docs/4.x/getting-started/deployment"}
15
15
 
16
16
  ::warning
17
17
  You should not touch any files inside since the whole directory will be re-created when running [`nuxt build`](/docs/4.x/api/commands/build).
@@ -13,4 +13,4 @@ The directory usually contains the following types of files:
13
13
 
14
14
  If you want to serve assets from the server, we recommend taking a look at the [`public/`](/docs/4.x/guide/directory-structure/public) directory.
15
15
 
16
- :read-more{to="/docs/getting-started/assets"}
16
+ :read-more{to="/docs/4.x/getting-started/assets"}
@@ -416,7 +416,7 @@ This feature only works with Nuxt auto-imports and `#components` imports. Explic
416
416
  `.client` components are rendered only after being mounted. To access the rendered template using `onMounted()`, add `await nextTick()` in the callback of the `onMounted()` hook.
417
417
  ::
418
418
 
419
- ::read-more{to="/docs/api/components/client-only"}
419
+ ::read-more{to="/docs/4.x/api/components/client-only"}
420
420
  You can also achieve a similar result with the `<ClientOnly>` component.
421
421
  ::
422
422
 
@@ -424,7 +424,7 @@ You can also achieve a similar result with the `<ClientOnly>` component.
424
424
 
425
425
  Server components allow server-rendering individual components within your client-side apps. It's possible to use server components within Nuxt, even if you are generating a static site. That makes it possible to build complex sites that mix dynamic components, server-rendered HTML and even static chunks of markup.
426
426
 
427
- Server components can either be used on their own or paired with a [client component](/docs/guide/directory-structure/app/components#paired-with-a-client-component).
427
+ Server components can either be used on their own or paired with a [client component](/docs/4.x/guide/directory-structure/app/components#paired-with-a-client-component).
428
428
 
429
429
  :video-accordion{title="Watch Learn Vue video about Nuxt Server Components" videoId="u1yyXe86xJM"}
430
430
 
@@ -547,7 +547,7 @@ In this case, the `.server` + `.client` components are two 'halves' of a compone
547
547
 
548
548
  There are a number of components that Nuxt provides, including `<ClientOnly>` and `<DevOnly>`. You can read more about them in the API documentation.
549
549
 
550
- ::read-more{to="/docs/api"}
550
+ ::read-more{to="/docs/4.x/api"}
551
551
  ::
552
552
 
553
553
  ## Library Authors
@@ -609,4 +609,4 @@ export default defineNuxtConfig({
609
609
 
610
610
  It will automatically import the components only if used and also support HMR when updating your components in `node_modules/awesome-ui/components/`.
611
611
 
612
- :link-example{to="/docs/examples/features/auto-imports"}
612
+ :link-example{to="/docs/4.x/examples/features/auto-imports"}