@nuxt/docs-nightly 4.1.3-29314777.50febbbb → 4.1.3-29316225.304409da

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 (139) hide show
  1. package/1.getting-started/03.configuration.md +19 -19
  2. package/1.getting-started/04.views.md +1 -1
  3. package/1.getting-started/05.assets.md +8 -2
  4. package/1.getting-started/06.styling.md +50 -40
  5. package/1.getting-started/07.routing.md +4 -4
  6. package/1.getting-started/08.seo-meta.md +46 -33
  7. package/1.getting-started/09.transitions.md +38 -33
  8. package/1.getting-started/10.data-fetching.md +47 -39
  9. package/1.getting-started/11.state-management.md +15 -8
  10. package/1.getting-started/12.error-handling.md +6 -4
  11. package/1.getting-started/13.server.md +3 -3
  12. package/1.getting-started/14.layers.md +18 -12
  13. package/1.getting-started/15.prerendering.md +24 -24
  14. package/1.getting-started/16.deployment.md +7 -7
  15. package/1.getting-started/17.testing.md +41 -41
  16. package/1.getting-started/18.upgrade.md +48 -66
  17. package/2.guide/1.directory-structure/1.app/1.components.md +36 -19
  18. package/2.guide/1.directory-structure/1.app/1.composables.md +7 -7
  19. package/2.guide/1.directory-structure/1.app/1.layouts.md +9 -5
  20. package/2.guide/1.directory-structure/1.app/1.middleware.md +20 -14
  21. package/2.guide/1.directory-structure/1.app/1.pages.md +19 -17
  22. package/2.guide/1.directory-structure/1.app/1.plugins.md +17 -17
  23. package/2.guide/1.directory-structure/1.app/1.utils.md +1 -1
  24. package/2.guide/1.directory-structure/1.app/3.app-config.md +6 -6
  25. package/2.guide/1.directory-structure/1.app/3.error.md +4 -4
  26. package/2.guide/1.directory-structure/1.content.md +4 -1
  27. package/2.guide/1.directory-structure/1.modules.md +4 -4
  28. package/2.guide/1.directory-structure/1.public.md +1 -1
  29. package/2.guide/1.directory-structure/1.server.md +28 -28
  30. package/2.guide/1.directory-structure/1.shared.md +1 -1
  31. package/2.guide/2.concepts/1.auto-imports.md +11 -11
  32. package/2.guide/2.concepts/2.vuejs-development.md +5 -5
  33. package/2.guide/2.concepts/3.rendering.md +14 -12
  34. package/2.guide/2.concepts/5.modules.md +2 -2
  35. package/2.guide/2.concepts/7.esm.md +14 -12
  36. package/2.guide/2.concepts/8.typescript.md +4 -4
  37. package/2.guide/3.going-further/1.events.md +2 -2
  38. package/2.guide/3.going-further/1.experimental-features.md +234 -73
  39. package/2.guide/3.going-further/1.features.md +44 -9
  40. package/2.guide/3.going-further/1.internals.md +15 -15
  41. package/2.guide/3.going-further/10.runtime-config.md +7 -7
  42. package/2.guide/3.going-further/2.hooks.md +8 -8
  43. package/2.guide/3.going-further/3.modules.md +76 -74
  44. package/2.guide/3.going-further/4.kit.md +3 -3
  45. package/2.guide/3.going-further/6.nuxt-app.md +1 -1
  46. package/2.guide/3.going-further/7.layers.md +50 -41
  47. package/2.guide/3.going-further/9.debugging.md +2 -2
  48. package/2.guide/4.recipes/1.custom-routing.md +19 -19
  49. package/2.guide/4.recipes/2.vite-plugin.md +3 -3
  50. package/2.guide/4.recipes/3.custom-usefetch.md +9 -9
  51. package/2.guide/4.recipes/4.sessions-and-authentication.md +33 -19
  52. package/2.guide/5.best-practices/performance.md +8 -8
  53. package/3.api/1.components/1.client-only.md +6 -3
  54. package/3.api/1.components/1.nuxt-client-fallback.md +9 -6
  55. package/3.api/1.components/11.teleports.md +4 -1
  56. package/3.api/1.components/12.nuxt-route-announcer.md +7 -7
  57. package/3.api/1.components/13.nuxt-time.md +44 -17
  58. package/3.api/1.components/2.nuxt-page.md +2 -2
  59. package/3.api/1.components/3.nuxt-layout.md +9 -4
  60. package/3.api/1.components/4.nuxt-link.md +38 -18
  61. package/3.api/1.components/6.nuxt-error-boundary.md +11 -9
  62. package/3.api/2.composables/on-prehydrate.md +2 -2
  63. package/3.api/2.composables/use-async-data.md +11 -11
  64. package/3.api/2.composables/use-cookie.md +26 -18
  65. package/3.api/2.composables/use-error.md +1 -1
  66. package/3.api/2.composables/use-fetch.md +13 -13
  67. package/3.api/2.composables/use-head-safe.md +5 -5
  68. package/3.api/2.composables/use-head.md +2 -2
  69. package/3.api/2.composables/use-hydration.md +5 -5
  70. package/3.api/2.composables/use-loading-indicator.md +10 -10
  71. package/3.api/2.composables/use-nuxt-app.md +9 -9
  72. package/3.api/2.composables/use-nuxt-data.md +7 -7
  73. package/3.api/2.composables/use-preview-mode.md +12 -15
  74. package/3.api/2.composables/use-request-fetch.md +1 -1
  75. package/3.api/2.composables/use-request-headers.md +3 -3
  76. package/3.api/2.composables/use-response-header.md +7 -8
  77. package/3.api/2.composables/use-route-announcer.md +3 -3
  78. package/3.api/2.composables/use-router.md +5 -3
  79. package/3.api/2.composables/use-runtime-config.md +6 -6
  80. package/3.api/2.composables/use-runtime-hook.md +1 -1
  81. package/3.api/2.composables/use-seo-meta.md +1 -1
  82. package/3.api/2.composables/use-server-seo-meta.md +1 -1
  83. package/3.api/2.composables/use-state.md +3 -3
  84. package/3.api/3.utils/$fetch.md +5 -3
  85. package/3.api/3.utils/abort-navigation.md +2 -2
  86. package/3.api/3.utils/add-route-middleware.md +3 -3
  87. package/3.api/3.utils/call-once.md +3 -3
  88. package/3.api/3.utils/clear-error.md +1 -1
  89. package/3.api/3.utils/clear-nuxt-data.md +2 -2
  90. package/3.api/3.utils/clear-nuxt-state.md +2 -2
  91. package/3.api/3.utils/create-error.md +1 -1
  92. package/3.api/3.utils/define-lazy-hydration-component.md +13 -13
  93. package/3.api/3.utils/define-nuxt-component.md +5 -5
  94. package/3.api/3.utils/define-nuxt-plugin.md +11 -11
  95. package/3.api/3.utils/define-nuxt-route-middleware.md +2 -2
  96. package/3.api/3.utils/define-page-meta.md +14 -14
  97. package/3.api/3.utils/define-route-rules.md +3 -3
  98. package/3.api/3.utils/navigate-to.md +9 -9
  99. package/3.api/3.utils/preload-components.md +1 -1
  100. package/3.api/3.utils/prerender-routes.md +2 -2
  101. package/3.api/3.utils/refresh-cookie.md +3 -3
  102. package/3.api/3.utils/refresh-nuxt-data.md +9 -4
  103. package/3.api/3.utils/reload-nuxt-app.md +2 -2
  104. package/3.api/3.utils/set-response-status.md +1 -1
  105. package/3.api/3.utils/show-error.md +2 -2
  106. package/3.api/3.utils/update-app-config.md +2 -1
  107. package/3.api/4.commands/prepare.md +4 -0
  108. package/3.api/5.kit/1.modules.md +36 -36
  109. package/3.api/5.kit/10.templates.md +8 -6
  110. package/3.api/5.kit/11.nitro.md +62 -62
  111. package/3.api/5.kit/12.resolving.md +2 -2
  112. package/3.api/5.kit/14.builder.md +1 -0
  113. package/3.api/5.kit/15.examples.md +2 -2
  114. package/3.api/5.kit/16.layers.md +26 -26
  115. package/3.api/5.kit/3.compatibility.md +12 -12
  116. package/3.api/5.kit/4.autoimports.md +12 -12
  117. package/3.api/5.kit/5.components.md +5 -5
  118. package/3.api/5.kit/6.context.md +3 -3
  119. package/3.api/5.kit/7.pages.md +4 -4
  120. package/3.api/5.kit/8.layout.md +1 -1
  121. package/3.api/5.kit/9.plugins.md +5 -4
  122. package/3.api/6.advanced/2.import-meta.md +3 -3
  123. package/3.api/6.nuxt-config.md +293 -858
  124. package/6.bridge/1.overview.md +1 -1
  125. package/6.bridge/10.configuration.md +2 -1
  126. package/6.bridge/2.typescript.md +2 -2
  127. package/6.bridge/3.bridge-composition-api.md +2 -2
  128. package/6.bridge/4.plugins-and-middleware.md +5 -5
  129. package/6.bridge/5.nuxt3-compatible-api.md +11 -8
  130. package/6.bridge/6.meta.md +15 -14
  131. package/6.bridge/8.nitro.md +2 -2
  132. package/6.bridge/9.vite.md +3 -3
  133. package/7.migration/2.configuration.md +17 -15
  134. package/7.migration/4.meta.md +17 -14
  135. package/7.migration/5.plugins-and-middleware.md +5 -5
  136. package/7.migration/6.pages-and-layouts.md +15 -11
  137. package/7.migration/7.component-options.md +3 -3
  138. package/7.migration/8.runtime-config.md +3 -3
  139. package/package.json +1 -1
@@ -26,13 +26,13 @@ export default defineNuxtModule({
26
26
  name: '@nuxt/ui',
27
27
  configKey: 'ui',
28
28
  },
29
- setup() {
29
+ setup () {
30
30
  addComponentsDir({
31
31
  path: resolve('./runtime/components'),
32
32
  prefix: 'U',
33
- pathPrefix: false
33
+ pathPrefix: false,
34
34
  })
35
- }
35
+ },
36
36
  })
37
37
  ```
38
38
 
@@ -76,14 +76,14 @@ Register a component to be automatically imported.
76
76
  ### Usage
77
77
 
78
78
  ```ts
79
- import { defineNuxtModule, createResolver, addComponent } from '@nuxt/kit'
79
+ import { addComponent, createResolver, defineNuxtModule } from '@nuxt/kit'
80
80
 
81
81
  export default defineNuxtModule({
82
82
  meta: {
83
83
  name: '@nuxt/image',
84
84
  configKey: 'image',
85
85
  },
86
- async setup() {
86
+ setup () {
87
87
  const resolver = createResolver(import.meta.url)
88
88
 
89
89
  addComponent({
@@ -37,7 +37,7 @@ const setupSomeFeature = () => {
37
37
  // @errors: 2391
38
38
  import type { Nuxt } from '@nuxt/schema'
39
39
  // ---cut---
40
- function useNuxt(): Nuxt
40
+ function useNuxt (): Nuxt
41
41
  ```
42
42
 
43
43
  ### Return Value
@@ -114,7 +114,7 @@ function setupSomething () {
114
114
  // @errors: 2391
115
115
  import type { Nuxt } from '@nuxt/schema'
116
116
  // ---cut---
117
- function tryUseNuxt(): Nuxt | null
117
+ function tryUseNuxt (): Nuxt | null
118
118
  ```
119
119
 
120
120
  ### Return Value
@@ -156,7 +156,7 @@ interface SiteConfig {
156
156
  title?: string
157
157
  }
158
158
  export const requireSiteConfig = (): SiteConfig => {
159
- return {}
159
+ return {}
160
160
  }
161
161
  // @filename: module.ts
162
162
  // ---cut---
@@ -39,7 +39,7 @@ export default defineNuxtModule({
39
39
  ### Type
40
40
 
41
41
  ```ts
42
- function extendPages(callback: (pages: NuxtPage[]) => void): void
42
+ function extendPages (callback: (pages: NuxtPage[]) => void): void
43
43
  ```
44
44
 
45
45
  ### Parameters
@@ -104,7 +104,7 @@ export default defineNuxtModule({
104
104
  ### Type
105
105
 
106
106
  ```ts
107
- function extendRouteRules(route: string, rule: NitroRouteConfig, options?: ExtendRouteRulesOptions): void
107
+ function extendRouteRules (route: string, rule: NitroRouteConfig, options?: ExtendRouteRulesOptions): void
108
108
  ```
109
109
 
110
110
  ### Parameters
@@ -157,7 +157,7 @@ export default defineNuxtModule({
157
157
  ```
158
158
 
159
159
  ```ts twoslash [runtime/auth.ts]
160
- function isAuthenticated(): boolean { return false }
160
+ function isAuthenticated (): boolean { return false }
161
161
  // ---cut---
162
162
  export default defineNuxtRouteMiddleware((to, from) => {
163
163
  // isAuthenticated() is an example method verifying if a user is authenticated
@@ -172,7 +172,7 @@ export default defineNuxtRouteMiddleware((to, from) => {
172
172
  ### Type
173
173
 
174
174
  ```ts
175
- function addRouteMiddleware(input: NuxtMiddleware | NuxtMiddleware[], options?: AddRouteMiddlewareOptions): void
175
+ function addRouteMiddleware (input: NuxtMiddleware | NuxtMiddleware[], options?: AddRouteMiddlewareOptions): void
176
176
  ```
177
177
 
178
178
  ### Parameters
@@ -38,7 +38,7 @@ export default defineNuxtModule({
38
38
  ### Type
39
39
 
40
40
  ```ts
41
- function addLayout(layout: NuxtTemplate | string, name: string): void
41
+ function addLayout (layout: NuxtTemplate | string, name: string): void
42
42
  ```
43
43
 
44
44
  ### Parameters
@@ -38,7 +38,7 @@ export default defineNuxtModule({
38
38
  ### Type
39
39
 
40
40
  ```ts
41
- function addPlugin(plugin: NuxtPlugin | string, options?: AddPluginOptions): NuxtPlugin
41
+ function addPlugin (plugin: NuxtPlugin | string, options?: AddPluginOptions): NuxtPlugin
42
42
  ```
43
43
 
44
44
  ### Parameters
@@ -128,7 +128,7 @@ export default defineNuxtPlugin({
128
128
  ### Type
129
129
 
130
130
  ```ts
131
- function addPluginTemplate(pluginOptions: NuxtPluginTemplate, options?: AddPluginOptions): NuxtPlugin
131
+ function addPluginTemplate (pluginOptions: NuxtPluginTemplate, options?: AddPluginOptions): NuxtPlugin
132
132
  ```
133
133
 
134
134
  ### Parameters
@@ -204,12 +204,13 @@ export default defineNuxtConfig({
204
204
 
205
205
  ```ts [#build/vue-app-config.mjs]
206
206
  import { defineNuxtPlugin } from '#app/nuxt'
207
+
207
208
  export default defineNuxtPlugin({
208
209
  name: 'nuxt:vue-app-config',
209
210
  enforce: 'pre',
210
211
  setup (nuxtApp) {
211
- nuxtApp.vueApp.config["idPrefix"] = "nuxt"
212
- }
212
+ nuxtApp.vueApp.config.idPrefix = 'nuxt'
213
+ },
213
214
  })
214
215
  ```
215
216
 
@@ -49,12 +49,12 @@ const resolver = createResolver(import.meta.url)
49
49
 
50
50
  export default defineNuxtModule({
51
51
  meta: { name: 'myModule' },
52
- setup() {
52
+ setup () {
53
53
  addComponent({
54
54
  name: 'MyModuleComponent',
55
55
  // Resolves to '/modules/my-module/components/MyModuleComponent.vue'
56
- filePath: resolver.resolve('./components/MyModuleComponent.vue')
56
+ filePath: resolver.resolve('./components/MyModuleComponent.vue'),
57
57
  })
58
- }
58
+ },
59
59
  })
60
60
  ```