@nuxt/docs-nightly 4.1.3-29300098.2f71703a → 4.1.3-29303775.dc69e26c

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 (146) hide show
  1. package/1.getting-started/01.introduction.md +2 -2
  2. package/1.getting-started/03.configuration.md +10 -10
  3. package/1.getting-started/04.views.md +6 -6
  4. package/1.getting-started/05.assets.md +7 -7
  5. package/1.getting-started/06.styling.md +5 -5
  6. package/1.getting-started/07.routing.md +8 -8
  7. package/1.getting-started/08.seo-meta.md +10 -10
  8. package/1.getting-started/09.transitions.md +11 -11
  9. package/1.getting-started/10.data-fetching.md +36 -36
  10. package/1.getting-started/11.state-management.md +7 -7
  11. package/1.getting-started/12.error-handling.md +9 -9
  12. package/1.getting-started/14.layers.md +3 -3
  13. package/1.getting-started/15.prerendering.md +4 -4
  14. package/1.getting-started/16.deployment.md +2 -2
  15. package/1.getting-started/17.testing.md +3 -3
  16. package/1.getting-started/18.upgrade.md +3 -3
  17. package/2.guide/1.concepts/1.auto-imports.md +8 -8
  18. package/2.guide/1.concepts/10.nuxt-lifecycle.md +10 -10
  19. package/2.guide/1.concepts/2.vuejs-development.md +4 -4
  20. package/2.guide/1.concepts/3.rendering.md +9 -9
  21. package/2.guide/1.concepts/4.server-engine.md +5 -5
  22. package/2.guide/1.concepts/5.modules.md +2 -2
  23. package/2.guide/1.concepts/7.esm.md +3 -3
  24. package/2.guide/1.concepts/8.typescript.md +8 -8
  25. package/2.guide/2.directory-structure/0.nuxt.md +2 -2
  26. package/2.guide/2.directory-structure/0.output.md +2 -2
  27. package/2.guide/2.directory-structure/1.app/1.assets.md +2 -2
  28. package/2.guide/2.directory-structure/1.app/1.components.md +5 -5
  29. package/2.guide/2.directory-structure/1.app/1.composables.md +3 -3
  30. package/2.guide/2.directory-structure/1.app/1.layouts.md +6 -6
  31. package/2.guide/2.directory-structure/1.app/1.middleware.md +7 -7
  32. package/2.guide/2.directory-structure/1.app/1.pages.md +14 -14
  33. package/2.guide/2.directory-structure/1.app/1.plugins.md +7 -7
  34. package/2.guide/2.directory-structure/1.app/1.utils.md +3 -3
  35. package/2.guide/2.directory-structure/1.app/3.app-config.md +5 -5
  36. package/2.guide/2.directory-structure/1.app/3.app.md +3 -3
  37. package/2.guide/2.directory-structure/1.app/3.error.md +1 -1
  38. package/2.guide/2.directory-structure/1.content.md +2 -2
  39. package/2.guide/2.directory-structure/1.modules.md +2 -2
  40. package/2.guide/2.directory-structure/1.node_modules.md +1 -1
  41. package/2.guide/2.directory-structure/1.server.md +5 -5
  42. package/2.guide/2.directory-structure/1.shared.md +2 -2
  43. package/2.guide/2.directory-structure/2.env.md +4 -4
  44. package/2.guide/2.directory-structure/2.nuxtignore.md +3 -3
  45. package/2.guide/2.directory-structure/2.nuxtrc.md +2 -2
  46. package/2.guide/2.directory-structure/3.nuxt-config.md +1 -1
  47. package/2.guide/2.directory-structure/3.tsconfig.md +2 -2
  48. package/2.guide/3.going-further/1.experimental-features.md +9 -9
  49. package/2.guide/3.going-further/1.internals.md +10 -10
  50. package/2.guide/3.going-further/10.runtime-config.md +4 -4
  51. package/2.guide/3.going-further/2.hooks.md +3 -3
  52. package/2.guide/3.going-further/3.modules.md +16 -16
  53. package/2.guide/3.going-further/4.kit.md +2 -2
  54. package/2.guide/3.going-further/6.nuxt-app.md +4 -4
  55. package/2.guide/3.going-further/7.layers.md +11 -11
  56. package/2.guide/4.recipes/1.custom-routing.md +11 -11
  57. package/2.guide/4.recipes/2.vite-plugin.md +1 -1
  58. package/2.guide/4.recipes/3.custom-usefetch.md +3 -3
  59. package/2.guide/4.recipes/4.sessions-and-authentication.md +1 -1
  60. package/2.guide/5.best-practices/hydration.md +4 -4
  61. package/2.guide/5.best-practices/performance.md +4 -4
  62. package/3.api/1.components/10.nuxt-picture.md +1 -1
  63. package/3.api/1.components/12.nuxt-route-announcer.md +2 -2
  64. package/3.api/1.components/2.nuxt-page.md +2 -2
  65. package/3.api/1.components/3.nuxt-layout.md +2 -2
  66. package/3.api/1.components/4.nuxt-link.md +3 -3
  67. package/3.api/1.components/5.nuxt-loading-indicator.md +2 -2
  68. package/3.api/2.composables/use-async-data.md +6 -6
  69. package/3.api/2.composables/use-cookie.md +2 -2
  70. package/3.api/2.composables/use-fetch.md +4 -4
  71. package/3.api/2.composables/use-head-safe.md +2 -2
  72. package/3.api/2.composables/use-head.md +2 -2
  73. package/3.api/2.composables/use-hydration.md +1 -1
  74. package/3.api/2.composables/use-lazy-async-data.md +2 -2
  75. package/3.api/2.composables/use-lazy-fetch.md +2 -2
  76. package/3.api/2.composables/use-loading-indicator.md +2 -2
  77. package/3.api/2.composables/use-nuxt-app.md +12 -12
  78. package/3.api/2.composables/use-nuxt-data.md +1 -1
  79. package/3.api/2.composables/use-preview-mode.md +3 -3
  80. package/3.api/2.composables/use-request-event.md +1 -1
  81. package/3.api/2.composables/use-request-fetch.md +2 -2
  82. package/3.api/2.composables/use-request-header.md +1 -1
  83. package/3.api/2.composables/use-request-headers.md +1 -1
  84. package/3.api/2.composables/use-request-url.md +1 -1
  85. package/3.api/2.composables/use-response-header.md +2 -2
  86. package/3.api/2.composables/use-route-announcer.md +1 -1
  87. package/3.api/2.composables/use-route.md +1 -1
  88. package/3.api/2.composables/use-router.md +4 -4
  89. package/3.api/2.composables/use-runtime-hook.md +1 -1
  90. package/3.api/2.composables/use-seo-meta.md +1 -1
  91. package/3.api/2.composables/use-server-seo-meta.md +3 -3
  92. package/3.api/2.composables/use-state.md +1 -1
  93. package/3.api/3.utils/$fetch.md +4 -4
  94. package/3.api/3.utils/abort-navigation.md +1 -1
  95. package/3.api/3.utils/add-route-middleware.md +2 -2
  96. package/3.api/3.utils/call-once.md +1 -1
  97. package/3.api/3.utils/clear-error.md +1 -1
  98. package/3.api/3.utils/clear-nuxt-data.md +1 -1
  99. package/3.api/3.utils/clear-nuxt-state.md +1 -1
  100. package/3.api/3.utils/define-nuxt-plugin.md +3 -3
  101. package/3.api/3.utils/define-nuxt-route-middleware.md +3 -3
  102. package/3.api/3.utils/define-page-meta.md +8 -8
  103. package/3.api/3.utils/define-route-rules.md +2 -2
  104. package/3.api/3.utils/navigate-to.md +1 -1
  105. package/3.api/3.utils/prefetch-components.md +1 -1
  106. package/3.api/3.utils/prerender-routes.md +1 -1
  107. package/3.api/3.utils/refresh-nuxt-data.md +2 -2
  108. package/3.api/3.utils/set-page-layout.md +1 -1
  109. package/3.api/3.utils/set-response-status.md +1 -1
  110. package/3.api/3.utils/show-error.md +2 -2
  111. package/3.api/3.utils/update-app-config.md +1 -1
  112. package/3.api/4.commands/module.md +2 -2
  113. package/3.api/4.commands/prepare.md +1 -1
  114. package/3.api/4.commands/preview.md +2 -2
  115. package/3.api/4.commands/typecheck.md +1 -1
  116. package/3.api/5.kit/10.runtime-config.md +1 -1
  117. package/3.api/5.kit/3.compatibility.md +2 -2
  118. package/3.api/5.kit/4.autoimports.md +1 -1
  119. package/3.api/5.kit/5.components.md +2 -2
  120. package/3.api/5.kit/7.pages.md +3 -3
  121. package/3.api/5.kit/8.layout.md +1 -1
  122. package/3.api/6.advanced/1.hooks.md +2 -2
  123. package/3.api/6.nuxt-config.md +4 -4
  124. package/5.community/2.getting-help.md +1 -1
  125. package/5.community/3.reporting-bugs.md +1 -1
  126. package/5.community/4.contribution.md +10 -10
  127. package/5.community/5.framework-contribution.md +4 -4
  128. package/5.community/6.roadmap.md +1 -1
  129. package/6.bridge/1.overview.md +12 -12
  130. package/6.bridge/2.typescript.md +1 -1
  131. package/6.bridge/3.bridge-composition-api.md +5 -5
  132. package/6.bridge/4.plugins-and-middleware.md +4 -4
  133. package/6.bridge/5.nuxt3-compatible-api.md +9 -9
  134. package/6.bridge/6.meta.md +5 -5
  135. package/6.bridge/7.runtime-config.md +1 -1
  136. package/6.bridge/8.nitro.md +1 -1
  137. package/6.bridge/9.vite.md +1 -1
  138. package/7.migration/1.overview.md +2 -2
  139. package/7.migration/2.configuration.md +5 -5
  140. package/7.migration/20.module-authors.md +6 -6
  141. package/7.migration/3.auto-imports.md +3 -3
  142. package/7.migration/4.meta.md +3 -3
  143. package/7.migration/6.pages-and-layouts.md +8 -8
  144. package/7.migration/7.component-options.md +11 -11
  145. package/7.migration/8.runtime-config.md +3 -3
  146. package/package.json +1 -1
@@ -12,14 +12,14 @@ We made everything so you can start writing `.vue` files from the beginning whil
12
12
  Nuxt has no vendor lock-in, allowing you to deploy your application [**everywhere, even on the edge**](/blog/nuxt-on-the-edge).
13
13
 
14
14
  ::tip
15
- If you want to play around with Nuxt in your browser, you can [try it out in one of our online sandboxes](/docs/getting-started/installation#play-online).
15
+ If you want to play around with Nuxt in your browser, you can [try it out in one of our online sandboxes](/docs/4.x/getting-started/installation#play-online).
16
16
  ::
17
17
 
18
18
  ## Automation and Conventions
19
19
 
20
20
  Nuxt uses conventions and an opinionated directory structure to automate repetitive tasks and allow developers to focus on pushing features. The configuration file can still customize and override its default behaviors.
21
21
 
22
- - **File-based routing:** define routes based on the structure of your [`app/pages/` directory](/docs/guide/directory-structure/app/pages). This can make it easier to organize your application and avoid the need for manual route configuration.
22
+ - **File-based routing:** define routes based on the structure of your [`app/pages/` directory](/docs/4.x/guide/directory-structure/app/pages). This can make it easier to organize your application and avoid the need for manual route configuration.
23
23
  - **Code splitting:** Nuxt automatically splits your code into smaller chunks, which can help reduce the initial load time of your application.
24
24
  - **Server-side rendering out of the box:** Nuxt comes with built-in SSR capabilities, so you don't have to set up a separate server yourself.
25
25
  - **Auto-imports:** write Vue composables and components in their respective directories and use them without having to import them with the benefits of tree-shaking and optimized JS bundles.
@@ -4,11 +4,11 @@ description: Nuxt is configured with sensible defaults to make you productive.
4
4
  navigation.icon: i-lucide-cog
5
5
  ---
6
6
 
7
- By default, Nuxt is configured to cover most use cases. The [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file can override or extend this default configuration.
7
+ By default, Nuxt is configured to cover most use cases. The [`nuxt.config.ts`](/docs/4.x/guide/directory-structure/nuxt-config) file can override or extend this default configuration.
8
8
 
9
9
  ## Nuxt Configuration
10
10
 
11
- The [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file is located at the root of a Nuxt project and can override or extend the application's behavior.
11
+ The [`nuxt.config.ts`](/docs/4.x/guide/directory-structure/nuxt-config) file is located at the root of a Nuxt project and can override or extend the application's behavior.
12
12
 
13
13
  A minimal configuration file exports the `defineNuxtConfig` function containing an object with your configuration. The `defineNuxtConfig` helper is globally available without import.
14
14
 
@@ -88,7 +88,7 @@ NUXT_API_SECRET=api_secret_token
88
88
 
89
89
  ::
90
90
 
91
- These variables are exposed to the rest of your application using the [`useRuntimeConfig()`](/docs/api/composables/use-runtime-config) composable.
91
+ These variables are exposed to the rest of your application using the [`useRuntimeConfig()`](/docs/4.x/api/composables/use-runtime-config) composable.
92
92
 
93
93
  ```vue [app/pages/index.vue]
94
94
  <script setup lang="ts">
@@ -116,7 +116,7 @@ export default defineAppConfig({
116
116
  })
117
117
  ```
118
118
 
119
- These variables are exposed to the rest of your application using the [`useAppConfig`](/docs/api/composables/use-app-config) composable.
119
+ These variables are exposed to the rest of your application using the [`useAppConfig`](/docs/4.x/api/composables/use-app-config) composable.
120
120
 
121
121
  ```vue [app/pages/index.vue]
122
122
  <script setup lang="ts">
@@ -145,20 +145,20 @@ Non primitive JS types | ❌ No | ✅ Yes
145
145
 
146
146
  ## External Configuration Files
147
147
 
148
- Nuxt uses [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) file as the single source of truth for configurations and skips reading external configuration files. During the course of building your project, you may have a need to configure those. The following table highlights common configurations and, where applicable, how they can be configured with Nuxt.
148
+ Nuxt uses [`nuxt.config.ts`](/docs/4.x/guide/directory-structure/nuxt-config) file as the single source of truth for configurations and skips reading external configuration files. During the course of building your project, you may have a need to configure those. The following table highlights common configurations and, where applicable, how they can be configured with Nuxt.
149
149
 
150
150
  Name | Config File | How To Configure
151
151
  ---------------------------------------------|---------------------------|-------------------------
152
- [Nitro](https://nitro.build) | ~~`nitro.config.ts`~~ | Use [`nitro`](/docs/api/nuxt-config#nitro) key in `nuxt.config`
153
- [PostCSS](https://postcss.org) | ~~`postcss.config.js`~~ | Use [`postcss`](/docs/api/nuxt-config#postcss) key in `nuxt.config`
154
- [Vite](https://vite.dev) | ~~`vite.config.ts`~~ | Use [`vite`](/docs/api/nuxt-config#vite) key in `nuxt.config`
155
- [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/api/nuxt-config#webpack-1) key in `nuxt.config`
152
+ [Nitro](https://nitro.build) | ~~`nitro.config.ts`~~ | Use [`nitro`](/docs/4.x/api/nuxt-config#nitro) key in `nuxt.config`
153
+ [PostCSS](https://postcss.org) | ~~`postcss.config.js`~~ | Use [`postcss`](/docs/4.x/api/nuxt-config#postcss) key in `nuxt.config`
154
+ [Vite](https://vite.dev) | ~~`vite.config.ts`~~ | Use [`vite`](/docs/4.x/api/nuxt-config#vite) key in `nuxt.config`
155
+ [webpack](https://webpack.js.org) | ~~`webpack.config.ts`~~ | Use [`webpack`](/docs/4.x/api/nuxt-config#webpack-1) key in `nuxt.config`
156
156
 
157
157
  Here is a list of other common config files:
158
158
 
159
159
  Name | Config File | How To Configure
160
160
  ---------------------------------------------|-------------------------|--------------------------
161
- [TypeScript](https://www.typescriptlang.org) | `tsconfig.json` | [More Info](/docs/guide/concepts/typescript#nuxttsconfigjson)
161
+ [TypeScript](https://www.typescriptlang.org) | `tsconfig.json` | [More Info](/docs/4.x/guide/directory-structure/tsconfig)
162
162
  [ESLint](https://eslint.org) | `eslint.config.js` | [More Info](https://eslint.org/docs/latest/use/configure/configuration-files)
163
163
  [Prettier](https://prettier.io) | `prettier.config.js` | [More Info](https://prettier.io/docs/en/configuration.html)
164
164
  [Stylelint](https://stylelint.io) | `stylelint.config.js` | [More Info](https://stylelint.io/user-guide/configure)
@@ -26,7 +26,7 @@ If you are familiar with Vue, you might wonder where `main.js` is (the file that
26
26
 
27
27
  ![Components are reusable pieces of UI](/assets/docs/getting-started/views/components.svg)
28
28
 
29
- Most components are reusable pieces of the user interface, like buttons and menus. In Nuxt, you can create these components in the [`app/components/`](/docs/guide/directory-structure/app/components) directory, and they will be automatically available across your application without having to explicitly import them.
29
+ Most components are reusable pieces of the user interface, like buttons and menus. In Nuxt, you can create these components in the [`app/components/`](/docs/4.x/guide/directory-structure/app/components) directory, and they will be automatically available across your application without having to explicitly import them.
30
30
 
31
31
  ::code-group
32
32
 
@@ -55,9 +55,9 @@ Most components are reusable pieces of the user interface, like buttons and menu
55
55
 
56
56
  ![Pages are views tied to a specific route](/assets/docs/getting-started/views/pages.svg)
57
57
 
58
- Pages represent views for each specific route pattern. Every file in the [`app/pages/`](/docs/guide/directory-structure/app/pages) directory represents a different route displaying its content.
58
+ Pages represent views for each specific route pattern. Every file in the [`app/pages/`](/docs/4.x/guide/directory-structure/app/pages) directory represents a different route displaying its content.
59
59
 
60
- To use pages, create an `app/pages/index.vue` file and add `<NuxtPage />` component to the [`app/app.vue`](/docs/guide/directory-structure/app) (or remove `app/app.vue` for default entry). You can now create more pages and their corresponding routes by adding new files in the [`app/pages/`](/docs/guide/directory-structure/app/pages) directory.
60
+ To use pages, create an `app/pages/index.vue` file and add `<NuxtPage />` component to the [`app/app.vue`](/docs/4.x/guide/directory-structure/app) (or remove `app/app.vue` for default entry). You can now create more pages and their corresponding routes by adding new files in the [`app/pages/`](/docs/4.x/guide/directory-structure/app/pages) directory.
61
61
 
62
62
  ::code-group
63
63
 
@@ -91,7 +91,7 @@ To use pages, create an `app/pages/index.vue` file and add `<NuxtPage />` compon
91
91
  Layouts are wrappers around pages that contain a common User Interface for several pages, such as header and footer displays. Layouts are Vue files using `<slot />` components to display the **page** content. The `app/layouts/default.vue` file will be used by default. Custom layouts can be set as part of your page metadata.
92
92
 
93
93
  ::note
94
- If you only have a single layout in your application, we recommend using [`app/app.vue`](/docs/guide/directory-structure/app) with [`<NuxtPage />`](/docs/api/components/nuxt-page) instead.
94
+ If you only have a single layout in your application, we recommend using [`app/app.vue`](/docs/4.x/guide/directory-structure/app) with [`<NuxtPage />`](/docs/4.x/api/components/nuxt-page) instead.
95
95
  ::
96
96
 
97
97
  ::code-group
@@ -137,12 +137,12 @@ If you only have a single layout in your application, we recommend using [`app/a
137
137
 
138
138
  ::
139
139
 
140
- If you want to create more layouts and learn how to use them in your pages, find more information in the [Layouts section](/docs/guide/directory-structure/app/layouts).
140
+ If you want to create more layouts and learn how to use them in your pages, find more information in the [Layouts section](/docs/4.x/guide/directory-structure/app/layouts).
141
141
 
142
142
  ## Advanced: Extending the HTML Template
143
143
 
144
144
  ::note
145
- If you only need to modify the `<head>`, you can refer to the [SEO and meta section](/docs/getting-started/seo-meta).
145
+ If you only need to modify the `<head>`, you can refer to the [SEO and meta section](/docs/4.x/getting-started/seo-meta).
146
146
  ::
147
147
 
148
148
  You can have full control over the HTML template by adding a Nitro plugin that registers a hook.
@@ -6,14 +6,14 @@ navigation.icon: i-lucide-image
6
6
 
7
7
  Nuxt uses two directories to handle assets like stylesheets, fonts or images.
8
8
 
9
- - The [`public/`](/docs/guide/directory-structure/public) directory content is served at the server root as-is.
10
- - The [`app/assets/`](/docs/guide/directory-structure/app/assets) directory contains by convention every asset that you want the build tool (Vite or webpack) to process.
9
+ - The [`public/`](/docs/4.x/guide/directory-structure/public) directory content is served at the server root as-is.
10
+ - The [`app/assets/`](/docs/4.x/guide/directory-structure/app/assets) directory contains by convention every asset that you want the build tool (Vite or webpack) to process.
11
11
 
12
12
  ## Public Directory
13
13
 
14
- The [`public/`](/docs/guide/directory-structure/public) directory is used as a public server for static assets publicly available at a defined URL of your application.
14
+ The [`public/`](/docs/4.x/guide/directory-structure/public) directory is used as a public server for static assets publicly available at a defined URL of your application.
15
15
 
16
- You can get a file in the [`public/`](/docs/guide/directory-structure/public) directory from your application's code or from a browser by the root URL `/`.
16
+ You can get a file in the [`public/`](/docs/4.x/guide/directory-structure/public) directory from your application's code or from a browser by the root URL `/`.
17
17
 
18
18
  ### Example
19
19
 
@@ -29,9 +29,9 @@ For example, referencing an image file in the `public/img/` directory, available
29
29
 
30
30
  Nuxt uses [Vite](https://vite.dev/guide/assets.html) (default) or [webpack](https://webpack.js.org/guides/asset-management) to build and bundle your application. The main function of these build tools is to process JavaScript files, but they can be extended through [plugins](https://vite.dev/plugins) (for Vite) or [loaders](https://webpack.js.org/loaders) (for webpack) to process other kinds of assets, like stylesheets, fonts or SVGs. This step transforms the original file, mainly for performance or caching purposes (such as stylesheet minification or browser cache invalidation).
31
31
 
32
- By convention, Nuxt uses the [`app/assets/`](/docs/guide/directory-structure/app/assets) directory to store these files but there is no auto-scan functionality for this directory, and you can use any other name for it.
32
+ By convention, Nuxt uses the [`app/assets/`](/docs/4.x/guide/directory-structure/app/assets) directory to store these files but there is no auto-scan functionality for this directory, and you can use any other name for it.
33
33
 
34
- In your application's code, you can reference a file located in the [`app/assets/`](/docs/guide/directory-structure/app/assets) directory by using the `~/assets/` path.
34
+ In your application's code, you can reference a file located in the [`app/assets/`](/docs/4.x/guide/directory-structure/app/assets) directory by using the `~/assets/` path.
35
35
 
36
36
  ### Example
37
37
 
@@ -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/guide/directory-structure/app/assets) directory at a static URL like `/assets/my-file.png`. If you need a static URL, use the [`public/`](#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/getting-started/assets#public-directory) directory.
48
48
  ::
@@ -9,7 +9,7 @@ You can use CSS preprocessors, CSS frameworks, UI libraries and Nuxt modules to
9
9
 
10
10
  ## Local Stylesheets
11
11
 
12
- If you're writing local stylesheets, the natural place to put them is the [`app/assets/` directory](/docs/guide/directory-structure/app/assets).
12
+ If you're writing local stylesheets, the natural place to put them is the [`app/assets/` directory](/docs/4.x/guide/directory-structure/app/assets).
13
13
 
14
14
  ### Importing Within Components
15
15
 
@@ -37,7 +37,7 @@ The stylesheets will be inlined in the HTML rendered by Nuxt.
37
37
  ### The CSS Property
38
38
 
39
39
  You can also use the `css` property in the Nuxt configuration.
40
- The natural place for your stylesheets is the [`app/assets/` directory](/docs/guide/directory-structure/app/assets). You can then reference its path and Nuxt will include it to all the pages of your application.
40
+ The natural place for your stylesheets is the [`app/assets/` directory](/docs/4.x/guide/directory-structure/app/assets). You can then reference its path and Nuxt will include it to all the pages of your application.
41
41
 
42
42
  ```ts [nuxt.config.ts]
43
43
  export default defineNuxtConfig({
@@ -121,7 +121,7 @@ export default defineNuxtConfig({
121
121
 
122
122
  You can include external stylesheets in your application by adding a link element in the head section of your nuxt.config file. You can achieve this result using different methods. Note that local stylesheets can also be included this way.
123
123
 
124
- You can manipulate the head with the [`app.head`](/docs/api/nuxt-config#head) property of your Nuxt configuration:
124
+ You can manipulate the head with the [`app.head`](/docs/4.x/api/nuxt-config#head) property of your Nuxt configuration:
125
125
 
126
126
  ```ts twoslash [nuxt.config.ts]
127
127
  export default defineNuxtConfig({
@@ -509,7 +509,7 @@ Here are a few modules to help you get started:
509
509
  - [Nuxt UI](https://ui.nuxt.com): A UI Library for Modern Web Apps
510
510
  - [Panda CSS](https://panda-css.com/docs/installation/nuxt): CSS-in-JS engine that generates atomic CSS at build time
511
511
 
512
- Nuxt modules provide you with a good developer experience out of the box, but remember that if your favorite tool doesn't have a module, it doesn't mean that you can't use it with Nuxt! You can configure it yourself for your own project. Depending on the tool, you might need to use a [Nuxt plugin](/docs/guide/directory-structure/plugins) and/or [make your own module](/docs/guide/going-further/modules). Share them with the [community](/modules) if you do!
512
+ Nuxt modules provide you with a good developer experience out of the box, but remember that if your favorite tool doesn't have a module, it doesn't mean that you can't use it with Nuxt! You can configure it yourself for your own project. Depending on the tool, you might need to use a [Nuxt plugin](/docs/4.x/guide/directory-structure/plugins) and/or [make your own module](/docs/4.x/guide/going-further/modules). Share them with the [community](/modules) if you do!
513
513
 
514
514
  ### Easily Load Webfonts
515
515
 
@@ -521,7 +521,7 @@ If you are using [UnoCSS](https://unocss.dev/integrations/nuxt), note that it co
521
521
 
522
522
  ### Transitions
523
523
 
524
- Nuxt comes with the same `<Transition>` element that Vue has, and also has support for the experimental [View Transitions API](/docs/getting-started/transitions#view-transitions-api-experimental).
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
526
  :read-more{to="/docs/getting-started/transitions"}
527
527
 
@@ -4,11 +4,11 @@ description: Nuxt file-system routing creates a route for every file in the page
4
4
  navigation.icon: i-lucide-milestone
5
5
  ---
6
6
 
7
- One core feature of Nuxt is the file system router. Every Vue file inside the [`app/pages/`](/docs/guide/directory-structure/app/pages) directory creates a corresponding URL (or route) that displays the contents of the file. By using dynamic imports for each page, Nuxt leverages code-splitting to ship the minimum amount of JavaScript for the requested route.
7
+ One core feature of Nuxt is the file system router. Every Vue file inside the [`app/pages/`](/docs/4.x/guide/directory-structure/app/pages) directory creates a corresponding URL (or route) that displays the contents of the file. By using dynamic imports for each page, Nuxt leverages code-splitting to ship the minimum amount of JavaScript for the requested route.
8
8
 
9
9
  ## Pages
10
10
 
11
- Nuxt routing is based on [vue-router](https://router.vuejs.org) and generates the routes from every component created in the [`app/pages/` directory](/docs/guide/directory-structure/app/pages), based on their filename.
11
+ Nuxt routing is based on [vue-router](https://router.vuejs.org) and generates the routes from every component created in the [`app/pages/` directory](/docs/4.x/guide/directory-structure/app/pages), based on their filename.
12
12
 
13
13
  This file system routing uses naming conventions to create dynamic and nested routes:
14
14
 
@@ -47,9 +47,9 @@ This file system routing uses naming conventions to create dynamic and nested ro
47
47
 
48
48
  ## Navigation
49
49
 
50
- The [`<NuxtLink>`](/docs/api/components/nuxt-link) component links pages between them. It renders an `<a>` tag with the `href` attribute set to the route of the page. Once the application is hydrated, page transitions are performed in JavaScript by updating the browser URL. This prevents full-page refreshes and allows for animated transitions.
50
+ The [`<NuxtLink>`](/docs/4.x/api/components/nuxt-link) component links pages between them. It renders an `<a>` tag with the `href` attribute set to the route of the page. Once the application is hydrated, page transitions are performed in JavaScript by updating the browser URL. This prevents full-page refreshes and allows for animated transitions.
51
51
 
52
- When a [`<NuxtLink>`](/docs/api/components/nuxt-link) enters the viewport on the client side, Nuxt will automatically prefetch components and payload (generated pages) of the linked pages ahead of time, resulting in faster navigation.
52
+ When a [`<NuxtLink>`](/docs/4.x/api/components/nuxt-link) enters the viewport on the client side, Nuxt will automatically prefetch components and payload (generated pages) of the linked pages ahead of time, resulting in faster navigation.
53
53
 
54
54
  ```vue [app/pages/index.vue]
55
55
  <template>
@@ -69,7 +69,7 @@ When a [`<NuxtLink>`](/docs/api/components/nuxt-link) enters the viewport on the
69
69
 
70
70
  ## Route Parameters
71
71
 
72
- The [`useRoute()`](/docs/api/composables/use-route) composable can be used in a `<script setup>` block or a `setup()` method of a Vue component to access the current route details.
72
+ The [`useRoute()`](/docs/4.x/api/composables/use-route) composable can be used in a `<script setup>` block or a `setup()` method of a Vue component to access the current route details.
73
73
 
74
74
  ```vue twoslash [pages/posts/[id\\].vue]
75
75
  <script setup lang="ts">
@@ -93,8 +93,8 @@ Route middleware runs within the Vue part of your Nuxt app. Despite the similar
93
93
  There are three kinds of route middleware:
94
94
 
95
95
  1. Anonymous (or inline) route middleware, which are defined directly in the pages where they are used.
96
- 2. Named route middleware, which are placed in the [`app/middleware/`](/docs/guide/directory-structure/app/middleware) directory and will be automatically loaded via asynchronous import when used on a page. (**Note**: The route middleware name is normalized to kebab-case, so `someMiddleware` becomes `some-middleware`.)
97
- 3. Global route middleware, which are placed in the [`app/middleware/`](/docs/guide/directory-structure/app/middleware) directory (with a `.global` suffix) and will be automatically run on every route change.
96
+ 2. Named route middleware, which are placed in the [`app/middleware/`](/docs/4.x/guide/directory-structure/app/middleware) directory and will be automatically loaded via asynchronous import when used on a page. (**Note**: The route middleware name is normalized to kebab-case, so `someMiddleware` becomes `some-middleware`.)
97
+ 3. Global route middleware, which are placed in the [`app/middleware/`](/docs/4.x/guide/directory-structure/app/middleware) directory (with a `.global` suffix) and will be automatically run on every route change.
98
98
 
99
99
  Example of an `auth` middleware protecting the `/dashboard` page:
100
100
 
@@ -129,7 +129,7 @@ definePageMeta({
129
129
 
130
130
  ## Route Validation
131
131
 
132
- Nuxt offers route validation via the `validate` property in [`definePageMeta()`](/docs/api/utils/define-page-meta) in each page you wish to validate.
132
+ Nuxt offers route validation via the `validate` property in [`definePageMeta()`](/docs/4.x/api/utils/define-page-meta) in each page you wish to validate.
133
133
 
134
134
  The `validate` property accepts the `route` as an argument. You can return a boolean value to determine whether or not this is a valid route to be rendered with this page. If you return `false`, this will cause a 404 error. You can also directly return an object with `statusCode`/`statusMessage` to customize the error returned.
135
135
 
@@ -9,7 +9,7 @@ and numerous configuration options to manage your app's head and SEO meta tags.
9
9
 
10
10
  ## Nuxt Config
11
11
 
12
- Providing an [`app.head`](/docs/api/nuxt-config#head) property in your [`nuxt.config.ts`](/docs/guide/directory-structure/nuxt-config) allows you to statically customize the head for your entire app.
12
+ Providing an [`app.head`](/docs/4.x/api/nuxt-config#head) property in your [`nuxt.config.ts`](/docs/4.x/guide/directory-structure/nuxt-config) allows you to statically customize the head for your entire app.
13
13
 
14
14
  ::important
15
15
  This method does not allow you to provide reactive data. We recommend using `useHead()` in `app.vue`.
@@ -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](#types).
36
+ You can also provide any of the keys listed below in [Types](/docs/getting-started/seo-meta#types).
37
37
 
38
38
  ### Defaults Tags
39
39
 
@@ -58,7 +58,7 @@ export default defineNuxtConfig({
58
58
 
59
59
  ## `useHead`
60
60
 
61
- The [`useHead`](/docs/api/composables/use-head) composable function supports reactive input, allowing you to manage your head tags programmatically.
61
+ The [`useHead`](/docs/4.x/api/composables/use-head) composable function supports reactive input, allowing you to manage your head tags programmatically.
62
62
 
63
63
  ```vue twoslash [app/app.vue]
64
64
  <script setup lang="ts">
@@ -75,11 +75,11 @@ useHead({
75
75
  </script>
76
76
  ```
77
77
 
78
- We recommend taking a look at the [`useHead`](/docs/api/composables/use-head) and [`useHeadSafe`](/docs/api/composables/use-head-safe) composables.
78
+ We recommend taking a look at the [`useHead`](/docs/4.x/api/composables/use-head) and [`useHeadSafe`](/docs/4.x/api/composables/use-head-safe) composables.
79
79
 
80
80
  ## `useSeoMeta`
81
81
 
82
- The [`useSeoMeta`](/docs/api/composables/use-seo-meta) composable lets you define your site's SEO meta tags as an object with full type safety.
82
+ The [`useSeoMeta`](/docs/4.x/api/composables/use-seo-meta) composable lets you define your site's SEO meta tags as an object with full type safety.
83
83
 
84
84
  This helps you avoid typos and common mistakes, such as using `name` instead of `property`.
85
85
 
@@ -100,7 +100,7 @@ useSeoMeta({
100
100
 
101
101
  ## Components
102
102
 
103
- While using [`useHead`](/docs/api/composables/use-head) is recommended in all cases, you may have a personal preference for defining your head tags in your template using components.
103
+ While using [`useHead`](/docs/4.x/api/composables/use-head) is recommended in all cases, you may have a personal preference for defining your head tags in your template using components.
104
104
 
105
105
  Nuxt provides the following components for this purpose: `<Title>`, `<Base>`, `<NoScript>`, `<Style>`, `<Meta>`, `<Link>`, `<Body>`, `<Html>` and `<Head>`. Note
106
106
  the capitalization of these components ensuring we don't use invalid native HTML tags.
@@ -133,7 +133,7 @@ It's suggested to wrap your components in either a `<Head>` or `<Html>` componen
133
133
 
134
134
  ## Types
135
135
 
136
- Below are the non-reactive types used for [`useHead`](/docs/api/composables/use-head), [`app.head`](/docs/api/nuxt-config#head) and components.
136
+ Below are the non-reactive types used for [`useHead`](/docs/4.x/api/composables/use-head), [`app.head`](/docs/4.x/api/nuxt-config#head) and components.
137
137
 
138
138
  ```ts
139
139
  interface MetaObject {
@@ -219,7 +219,7 @@ If you want to use a function (for full control), then this cannot be set in you
219
219
 
220
220
  ::
221
221
 
222
- Now, if you set the title to `My Page` with [`useHead`](/docs/api/composables/use-head) on another page of your site, the title would appear as 'My Page - Site Title' in the browser tab. You could also pass `null` to default to 'Site Title'.
222
+ Now, if you set the title to `My Page` with [`useHead`](/docs/4.x/api/composables/use-head) on another page of your site, the title would appear as 'My Page - Site Title' in the browser tab. You could also pass `null` to default to 'Site Title'.
223
223
 
224
224
  ### Template Params
225
225
 
@@ -267,7 +267,7 @@ useHead({
267
267
 
268
268
  ### With `definePageMeta`
269
269
 
270
- Within your [`app/pages/` directory](/docs/guide/directory-structure/app/pages), you can use `definePageMeta` along with [`useHead`](/docs/api/composables/use-head) to set metadata based on the current route.
270
+ Within your [`app/pages/` directory](/docs/4.x/guide/directory-structure/app/pages), you can use `definePageMeta` along with [`useHead`](/docs/4.x/api/composables/use-head) to set metadata based on the current route.
271
271
 
272
272
  For example, you can first set the current page title (this is extracted at build time via a macro, so it can't be set dynamically):
273
273
 
@@ -326,7 +326,7 @@ useHead({
326
326
 
327
327
  ### External CSS
328
328
 
329
- The example below shows how you might enable Google Fonts using either the `link` property of the [`useHead`](/docs/api/composables/use-head) composable or using the `<Link>` component:
329
+ The example below shows how you might enable Google Fonts using either the `link` property of the [`useHead`](/docs/4.x/api/composables/use-head) composable or using the `<Link>` component:
330
330
 
331
331
  ::code-group
332
332
 
@@ -10,7 +10,7 @@ Nuxt leverages Vue's [`<Transition>`](https://vuejs.org/guide/built-ins/transiti
10
10
 
11
11
  ## Page Transitions
12
12
 
13
- You can enable page transitions to apply an automatic transition for all your [pages](/docs/guide/directory-structure/app/pages).
13
+ You can enable page transitions to apply an automatic transition for all your [pages](/docs/4.x/guide/directory-structure/app/pages).
14
14
 
15
15
  ```ts twoslash [nuxt.config.ts]
16
16
  export default defineNuxtConfig({
@@ -21,10 +21,10 @@ export default defineNuxtConfig({
21
21
  ```
22
22
 
23
23
  ::note
24
- If you are changing layouts as well as page, the page transition you set here will not run. Instead, you should set a [layout transition](/docs/getting-started/transitions#layout-transitions).
24
+ If you are changing layouts as well as page, the page transition you set here will not run. Instead, you should set a [layout transition](/docs/4.x/getting-started/transitions#layout-transitions).
25
25
  ::
26
26
 
27
- To start adding transition between your pages, add the following CSS to your [`app.vue`](/docs/guide/directory-structure/app):
27
+ To start adding transition between your pages, add the following CSS to your [`app.vue`](/docs/4.x/guide/directory-structure/app):
28
28
 
29
29
  ::code-group
30
30
 
@@ -72,7 +72,7 @@ This produces the following result when navigating between pages:
72
72
  <source src="https://res.cloudinary.com/nuxt/video/upload/v1665061349/nuxt3/nuxt3-page-transitions_umwvmh.mp4" type="video/mp4">
73
73
  </video>
74
74
 
75
- To set a different transition for a page, set the `pageTransition` key in [`definePageMeta`](/docs/api/utils/define-page-meta) of the page:
75
+ To set a different transition for a page, set the `pageTransition` key in [`definePageMeta`](/docs/4.x/api/utils/define-page-meta) of the page:
76
76
 
77
77
  ::code-group
78
78
 
@@ -115,7 +115,7 @@ Moving to the about page will add the 3d rotation effect:
115
115
 
116
116
  ## Layout Transitions
117
117
 
118
- You can enable layout transitions to apply an automatic transition for all your [layouts](/docs/guide/directory-structure/app/layouts).
118
+ You can enable layout transitions to apply an automatic transition for all your [layouts](/docs/4.x/guide/directory-structure/app/layouts).
119
119
 
120
120
  ```ts twoslash [nuxt.config.ts]
121
121
  export default defineNuxtConfig({
@@ -125,7 +125,7 @@ export default defineNuxtConfig({
125
125
  })
126
126
  ```
127
127
 
128
- To start adding transition between your pages and layouts, add the following CSS to your [`app.vue`](/docs/guide/directory-structure/app):
128
+ To start adding transition between your pages and layouts, add the following CSS to your [`app.vue`](/docs/4.x/guide/directory-structure/app):
129
129
 
130
130
  ::code-group
131
131
 
@@ -315,7 +315,7 @@ Learn more about additional [JavaScript hooks](https://vuejs.org/guide/built-ins
315
315
 
316
316
  ## Dynamic Transitions
317
317
 
318
- To apply dynamic transitions using conditional logic, you can leverage inline [middleware](/docs/guide/directory-structure/app/middleware) to assign a different transition name to `to.meta.pageTransition`.
318
+ To apply dynamic transitions using conditional logic, you can leverage inline [middleware](/docs/4.x/guide/directory-structure/app/middleware) to assign a different transition name to `to.meta.pageTransition`.
319
319
 
320
320
  ::code-group
321
321
 
@@ -415,9 +415,9 @@ Remember, this page transition cannot be overridden with `definePageMeta` on ind
415
415
 
416
416
  Nuxt ships with an experimental implementation of the [**View Transitions API**](https://developer.chrome.com/docs/web-platform/view-transitions) (see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API)). This is an exciting new way to implement native browser transitions which (among other things) have the ability to transition between unrelated elements on different pages.
417
417
 
418
- You can check a demo on https://nuxt-view-transitions.surge.sh and the [source on StackBlitz](https://stackblitz.com/edit/nuxt-view-transitions).
418
+ You can check a demo [on StackBlitz](https://stackblitz.com/edit/nuxt-view-transitions).
419
419
 
420
- The Nuxt integration is under active development, but can be enabled with the `experimental.viewTransition` option in your configuration file:
420
+ The Nuxt integration can be enabled with the `experimental.viewTransition` option in your configuration file:
421
421
 
422
422
  ```ts twoslash [nuxt.config.ts]
423
423
  export default defineNuxtConfig({
@@ -431,7 +431,7 @@ The possible values are: `false`, `true`, or `'always'`.
431
431
 
432
432
  If set to true, Nuxt will not apply transitions if the user's browser matches `prefers-reduced-motion: reduce` (recommended). If set to `always`, Nuxt will always apply the transition and it is up to you to respect the user's preference.
433
433
 
434
- By default, view transitions are enabled for all [pages](/docs/guide/directory-structure/app/pages), but you can set a different global default.
434
+ By default, view transitions are enabled for all [pages](/docs/4.x/guide/directory-structure/app/pages), but you can set a different global default.
435
435
 
436
436
  ```ts twoslash [nuxt.config.ts]
437
437
  export default defineNuxtConfig({
@@ -442,7 +442,7 @@ export default defineNuxtConfig({
442
442
  })
443
443
  ```
444
444
 
445
- It is possible to override the default `viewTransition` value for a page by setting the `viewTransition` key in [`definePageMeta`](/docs/api/utils/define-page-meta) of the page:
445
+ It is possible to override the default `viewTransition` value for a page by setting the `viewTransition` key in [`definePageMeta`](/docs/4.x/api/utils/define-page-meta) of the page:
446
446
 
447
447
  ```vue twoslash [pages/about.vue]
448
448
  <script setup lang="ts">