@nuxt/docs-nightly 4.1.3-29313386.edc02e27 → 4.1.3-29316215.910d159d
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.
- package/1.getting-started/01.introduction.md +4 -4
- package/1.getting-started/02.installation.md +1 -1
- package/1.getting-started/03.configuration.md +25 -25
- package/1.getting-started/04.views.md +3 -3
- package/1.getting-started/05.assets.md +9 -3
- package/1.getting-started/06.styling.md +53 -43
- package/1.getting-started/07.routing.md +9 -9
- package/1.getting-started/08.seo-meta.md +50 -37
- package/1.getting-started/09.transitions.md +38 -33
- package/1.getting-started/10.data-fetching.md +61 -53
- package/1.getting-started/11.state-management.md +19 -12
- package/1.getting-started/12.error-handling.md +17 -15
- package/1.getting-started/13.server.md +8 -8
- package/1.getting-started/14.layers.md +19 -13
- package/1.getting-started/15.prerendering.md +28 -28
- package/1.getting-started/16.deployment.md +8 -8
- package/1.getting-started/17.testing.md +42 -42
- package/1.getting-started/18.upgrade.md +50 -68
- package/2.guide/0.index.md +5 -5
- package/2.guide/1.directory-structure/0.output.md +1 -1
- package/2.guide/1.directory-structure/1.app/1.assets.md +1 -1
- package/2.guide/1.directory-structure/1.app/1.components.md +40 -23
- package/2.guide/1.directory-structure/1.app/1.composables.md +9 -9
- package/2.guide/1.directory-structure/1.app/1.layouts.md +12 -8
- package/2.guide/1.directory-structure/1.app/1.middleware.md +23 -17
- package/2.guide/1.directory-structure/1.app/1.pages.md +25 -23
- package/2.guide/1.directory-structure/1.app/1.plugins.md +17 -17
- package/2.guide/1.directory-structure/1.app/1.utils.md +3 -3
- package/2.guide/1.directory-structure/1.app/3.app-config.md +7 -7
- package/2.guide/1.directory-structure/1.app/3.app.md +3 -3
- package/2.guide/1.directory-structure/1.app/3.error.md +4 -4
- package/2.guide/1.directory-structure/1.content.md +4 -1
- package/2.guide/1.directory-structure/1.modules.md +5 -5
- package/2.guide/1.directory-structure/1.public.md +1 -1
- package/2.guide/1.directory-structure/1.server.md +30 -30
- package/2.guide/1.directory-structure/1.shared.md +3 -3
- package/2.guide/1.directory-structure/2.env.md +3 -3
- package/2.guide/1.directory-structure/2.nuxtrc.md +1 -1
- package/2.guide/1.directory-structure/3.nuxt-config.md +1 -1
- package/2.guide/2.concepts/1.auto-imports.md +15 -15
- package/2.guide/2.concepts/10.nuxt-lifecycle.md +7 -7
- package/2.guide/2.concepts/2.vuejs-development.md +9 -9
- package/2.guide/2.concepts/3.rendering.md +17 -15
- package/2.guide/2.concepts/4.server-engine.md +1 -1
- package/2.guide/2.concepts/5.modules.md +3 -3
- package/2.guide/2.concepts/7.esm.md +16 -14
- package/2.guide/2.concepts/8.typescript.md +4 -4
- package/2.guide/3.going-further/1.events.md +3 -3
- package/2.guide/3.going-further/1.experimental-features.md +238 -77
- package/2.guide/3.going-further/1.features.md +44 -9
- package/2.guide/3.going-further/1.internals.md +15 -15
- package/2.guide/3.going-further/10.runtime-config.md +8 -8
- package/2.guide/3.going-further/11.nightly-release-channel.md +1 -1
- package/2.guide/3.going-further/2.hooks.md +11 -11
- package/2.guide/3.going-further/3.modules.md +83 -81
- package/2.guide/3.going-further/4.kit.md +5 -5
- package/2.guide/3.going-further/6.nuxt-app.md +4 -4
- package/2.guide/3.going-further/7.layers.md +51 -42
- package/2.guide/3.going-further/9.debugging.md +2 -2
- package/2.guide/4.recipes/1.custom-routing.md +19 -19
- package/2.guide/4.recipes/2.vite-plugin.md +3 -3
- package/2.guide/4.recipes/3.custom-usefetch.md +10 -10
- package/2.guide/4.recipes/4.sessions-and-authentication.md +34 -20
- package/2.guide/5.best-practices/performance.md +13 -13
- package/3.api/1.components/1.client-only.md +6 -3
- package/3.api/1.components/1.nuxt-client-fallback.md +10 -7
- package/3.api/1.components/11.teleports.md +5 -2
- package/3.api/1.components/12.nuxt-route-announcer.md +7 -7
- package/3.api/1.components/13.nuxt-time.md +44 -17
- package/3.api/1.components/2.nuxt-page.md +4 -4
- package/3.api/1.components/3.nuxt-layout.md +13 -8
- package/3.api/1.components/4.nuxt-link.md +40 -20
- package/3.api/1.components/5.nuxt-loading-indicator.md +1 -1
- package/3.api/1.components/6.nuxt-error-boundary.md +12 -10
- package/3.api/2.composables/on-prehydrate.md +2 -2
- package/3.api/2.composables/use-app-config.md +1 -1
- package/3.api/2.composables/use-async-data.md +14 -14
- package/3.api/2.composables/use-cookie.md +27 -19
- package/3.api/2.composables/use-error.md +2 -2
- package/3.api/2.composables/use-fetch.md +17 -17
- package/3.api/2.composables/use-head-safe.md +5 -5
- package/3.api/2.composables/use-head.md +3 -3
- package/3.api/2.composables/use-hydration.md +5 -5
- package/3.api/2.composables/use-lazy-async-data.md +2 -2
- package/3.api/2.composables/use-lazy-fetch.md +2 -2
- package/3.api/2.composables/use-loading-indicator.md +10 -10
- package/3.api/2.composables/use-nuxt-app.md +10 -10
- package/3.api/2.composables/use-nuxt-data.md +7 -7
- package/3.api/2.composables/use-preview-mode.md +12 -15
- package/3.api/2.composables/use-request-fetch.md +1 -1
- package/3.api/2.composables/use-request-headers.md +3 -3
- package/3.api/2.composables/use-response-header.md +7 -8
- package/3.api/2.composables/use-route-announcer.md +3 -3
- package/3.api/2.composables/use-router.md +6 -4
- package/3.api/2.composables/use-runtime-config.md +11 -11
- package/3.api/2.composables/use-runtime-hook.md +1 -1
- package/3.api/2.composables/use-seo-meta.md +3 -3
- package/3.api/2.composables/use-server-seo-meta.md +3 -3
- package/3.api/2.composables/use-state.md +4 -4
- package/3.api/3.utils/$fetch.md +6 -4
- package/3.api/3.utils/abort-navigation.md +2 -2
- package/3.api/3.utils/add-route-middleware.md +3 -3
- package/3.api/3.utils/call-once.md +5 -5
- package/3.api/3.utils/clear-error.md +2 -2
- package/3.api/3.utils/clear-nuxt-data.md +2 -2
- package/3.api/3.utils/clear-nuxt-state.md +2 -2
- package/3.api/3.utils/create-error.md +2 -2
- package/3.api/3.utils/define-lazy-hydration-component.md +13 -13
- package/3.api/3.utils/define-nuxt-component.md +5 -5
- package/3.api/3.utils/define-nuxt-plugin.md +12 -12
- package/3.api/3.utils/define-nuxt-route-middleware.md +2 -2
- package/3.api/3.utils/define-page-meta.md +16 -16
- package/3.api/3.utils/define-route-rules.md +5 -5
- package/3.api/3.utils/navigate-to.md +10 -10
- package/3.api/3.utils/preload-components.md +1 -1
- package/3.api/3.utils/preload-route-components.md +2 -2
- package/3.api/3.utils/prerender-routes.md +2 -2
- package/3.api/3.utils/refresh-cookie.md +4 -4
- package/3.api/3.utils/refresh-nuxt-data.md +10 -5
- package/3.api/3.utils/reload-nuxt-app.md +3 -3
- package/3.api/3.utils/set-response-status.md +2 -2
- package/3.api/3.utils/show-error.md +3 -3
- package/3.api/3.utils/update-app-config.md +3 -2
- package/3.api/4.commands/generate.md +1 -1
- package/3.api/4.commands/prepare.md +4 -0
- package/3.api/4.commands/typecheck.md +1 -1
- package/3.api/5.kit/1.modules.md +36 -36
- package/3.api/5.kit/10.templates.md +8 -6
- package/3.api/5.kit/11.nitro.md +62 -62
- package/3.api/5.kit/12.resolving.md +2 -2
- package/3.api/5.kit/14.builder.md +1 -0
- package/3.api/5.kit/15.examples.md +2 -2
- package/3.api/5.kit/16.layers.md +26 -26
- package/3.api/5.kit/3.compatibility.md +12 -12
- package/3.api/5.kit/4.autoimports.md +12 -12
- package/3.api/5.kit/5.components.md +5 -5
- package/3.api/5.kit/6.context.md +3 -3
- package/3.api/5.kit/7.pages.md +4 -4
- package/3.api/5.kit/8.layout.md +1 -1
- package/3.api/5.kit/9.plugins.md +5 -4
- package/3.api/6.advanced/1.hooks.md +1 -1
- package/3.api/6.advanced/2.import-meta.md +3 -3
- package/3.api/6.nuxt-config.md +299 -864
- package/3.api/index.md +7 -7
- package/5.community/4.contribution.md +5 -5
- package/5.community/5.framework-contribution.md +1 -1
- package/6.bridge/1.overview.md +1 -1
- package/6.bridge/10.configuration.md +2 -1
- package/6.bridge/2.typescript.md +2 -2
- package/6.bridge/3.bridge-composition-api.md +4 -4
- package/6.bridge/4.plugins-and-middleware.md +5 -5
- package/6.bridge/5.nuxt3-compatible-api.md +12 -9
- package/6.bridge/6.meta.md +15 -14
- package/6.bridge/8.nitro.md +2 -2
- package/6.bridge/9.vite.md +3 -3
- package/7.migration/10.bundling.md +1 -1
- package/7.migration/11.server.md +3 -3
- package/7.migration/2.configuration.md +18 -16
- package/7.migration/20.module-authors.md +1 -1
- package/7.migration/4.meta.md +18 -15
- package/7.migration/5.plugins-and-middleware.md +8 -8
- package/7.migration/6.pages-and-layouts.md +20 -16
- package/7.migration/7.component-options.md +7 -7
- package/7.migration/8.runtime-config.md +4 -4
- package/package.json +1 -1
|
@@ -13,9 +13,9 @@ If you don't have an `app.vue` file in your source directory, Nuxt will use its
|
|
|
13
13
|
|
|
14
14
|
This file is a great place to put any custom code that needs to be run once when your app starts up, as well as any components that are present on every page of your app. For example, if you only have one layout, you can move this to `app.vue` instead.
|
|
15
15
|
|
|
16
|
-
:read-more{to="/docs/guide/directory-structure/app"}
|
|
16
|
+
:read-more{to="/docs/4.x/guide/directory-structure/app"}
|
|
17
17
|
|
|
18
|
-
:link-example{to="/docs/examples/hello-world"}
|
|
18
|
+
:link-example{to="/docs/4.x/examples/hello-world"}
|
|
19
19
|
|
|
20
20
|
### Migration
|
|
21
21
|
|
|
@@ -84,13 +84,13 @@ In Nuxt 2, you will have defined any nested routes (with parent and child compon
|
|
|
84
84
|
|
|
85
85
|
If you were passing a custom page key or keep-alive props to `<Nuxt>`, you will now use `definePageMeta` to set these options.
|
|
86
86
|
|
|
87
|
-
:read-more{to="/docs/guide/directory-structure/app/pages#special-metadata"}
|
|
87
|
+
:read-more{to="/docs/4.x/guide/directory-structure/app/pages#special-metadata"}
|
|
88
88
|
|
|
89
89
|
### Page and Layout Transitions
|
|
90
90
|
|
|
91
91
|
If you have been defining transitions for your page or layout directly in your component options, you will now need to use `definePageMeta` to set the transition. Since Vue 3, [-enter and -leave CSS classes have been renamed](https://v3-migration.vuejs.org/breaking-changes/transition.html). The `style` prop from `<Nuxt>` no longer applies to transition when used on `<slot>`, so move the styles to your `-active` class.
|
|
92
92
|
|
|
93
|
-
:read-more{to="/docs/getting-started/transitions"}
|
|
93
|
+
:read-more{to="/docs/4.x/getting-started/transitions"}
|
|
94
94
|
|
|
95
95
|
### Migration
|
|
96
96
|
|
|
@@ -145,13 +145,17 @@ If you have been defining transitions for your page or layout directly in your c
|
|
|
145
145
|
```vue [Nuxt 2]
|
|
146
146
|
<template>
|
|
147
147
|
<div>
|
|
148
|
-
<NuxtChild
|
|
148
|
+
<NuxtChild
|
|
149
|
+
keep-alive
|
|
150
|
+
:keep-alive-props="{ exclude: ['modal'] }"
|
|
151
|
+
:nuxt-child-key="$route.slug"
|
|
152
|
+
/>
|
|
149
153
|
</div>
|
|
150
154
|
</template>
|
|
151
155
|
|
|
152
156
|
<script>
|
|
153
157
|
export default {
|
|
154
|
-
transition: 'page' // or { name: 'page' }
|
|
158
|
+
transition: 'page', // or { name: 'page' }
|
|
155
159
|
}
|
|
156
160
|
</script>
|
|
157
161
|
```
|
|
@@ -172,7 +176,7 @@ definePageMeta({
|
|
|
172
176
|
name: 'page',
|
|
173
177
|
},
|
|
174
178
|
keepalive: {
|
|
175
|
-
exclude: ['modal']
|
|
179
|
+
exclude: ['modal'],
|
|
176
180
|
},
|
|
177
181
|
})
|
|
178
182
|
</script>
|
|
@@ -186,7 +190,7 @@ Most of the syntax and functionality are the same for the global [NuxtLink](/doc
|
|
|
186
190
|
|
|
187
191
|
`<NuxtLink>` is now a drop-in replacement for _all_ links, even external ones. You can read more about it, and how to extend it to provide your own link component.
|
|
188
192
|
|
|
189
|
-
:read-more{to="/docs/api/components/nuxt-link"}
|
|
193
|
+
:read-more{to="/docs/4.x/api/components/nuxt-link"}
|
|
190
194
|
|
|
191
195
|
## Programmatic Navigation
|
|
192
196
|
|
|
@@ -202,29 +206,29 @@ Make sure to always `await` on [`navigateTo`](/docs/4.x/api/utils/navigate-to) o
|
|
|
202
206
|
<script>
|
|
203
207
|
export default {
|
|
204
208
|
methods: {
|
|
205
|
-
navigate(){
|
|
209
|
+
navigate () {
|
|
206
210
|
this.$router.push({
|
|
207
211
|
path: '/search',
|
|
208
212
|
query: {
|
|
209
213
|
name: 'first name',
|
|
210
|
-
type: '1'
|
|
211
|
-
}
|
|
214
|
+
type: '1',
|
|
215
|
+
},
|
|
212
216
|
})
|
|
213
|
-
}
|
|
214
|
-
}
|
|
217
|
+
},
|
|
218
|
+
},
|
|
215
219
|
}
|
|
216
220
|
</script>
|
|
217
221
|
```
|
|
218
222
|
|
|
219
223
|
```vue [Nuxt 3]
|
|
220
224
|
<script setup lang="ts">
|
|
221
|
-
function navigate(){
|
|
225
|
+
function navigate () {
|
|
222
226
|
return navigateTo({
|
|
223
227
|
path: '/search',
|
|
224
228
|
query: {
|
|
225
229
|
name: 'first name',
|
|
226
|
-
type: '1'
|
|
227
|
-
}
|
|
230
|
+
type: '1',
|
|
231
|
+
},
|
|
228
232
|
})
|
|
229
233
|
}
|
|
230
234
|
</script>
|
|
@@ -30,14 +30,14 @@ In Nuxt 2, you'd fetch your data in your component using a syntax similar to:
|
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
32
|
export default {
|
|
33
|
-
async asyncData({ params, $http }) {
|
|
33
|
+
async asyncData ({ params, $http }) {
|
|
34
34
|
const post = await $http.$get(`https://api.nuxtjs.dev/posts/${params.id}`)
|
|
35
35
|
return { post }
|
|
36
36
|
},
|
|
37
37
|
// or alternatively
|
|
38
38
|
fetch () {
|
|
39
39
|
this.post = await $http.$get(`https://api.nuxtjs.dev/posts/${params.id}`)
|
|
40
|
-
}
|
|
40
|
+
},
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -48,7 +48,7 @@ With Nuxt 3, you can perform this data fetching using composables in your `setup
|
|
|
48
48
|
```vue
|
|
49
49
|
<script setup lang="ts">
|
|
50
50
|
// Define params wherever, through `defineProps()`, `useRoute()`, etc.
|
|
51
|
-
const { data: post, refresh } = await useAsyncData('post', () => $fetch(`https://api.nuxtjs.dev/posts/${params.id}`)
|
|
51
|
+
const { data: post, refresh } = await useAsyncData('post', () => $fetch(`https://api.nuxtjs.dev/posts/${params.id}`))
|
|
52
52
|
// Or instead - useFetch is a convenience wrapper around useAsyncData when you're just performing a simple fetch
|
|
53
53
|
const { data: post, refresh } = await useFetch(`https://api.nuxtjs.dev/posts/${params.id}`)
|
|
54
54
|
</script>
|
|
@@ -67,7 +67,7 @@ Despite the names, [`useFetch`](/docs/4.x/api/composables/use-fetch) is not a di
|
|
|
67
67
|
|
|
68
68
|
## `head`
|
|
69
69
|
|
|
70
|
-
:read-more{to="/docs/migration/meta"}
|
|
70
|
+
:read-more{to="/docs/4.x/migration/meta"}
|
|
71
71
|
|
|
72
72
|
## `key`
|
|
73
73
|
|
|
@@ -91,7 +91,7 @@ You can now define a key within the [`definePageMeta`](/docs/4.x/api/utils/defin
|
|
|
91
91
|
|
|
92
92
|
## `layout`
|
|
93
93
|
|
|
94
|
-
:read-more{to="/docs/migration/pages-and-layouts"}
|
|
94
|
+
:read-more{to="/docs/4.x/migration/pages-and-layouts"}
|
|
95
95
|
|
|
96
96
|
## `loading`
|
|
97
97
|
|
|
@@ -99,7 +99,7 @@ This feature is not yet supported in Nuxt 3.
|
|
|
99
99
|
|
|
100
100
|
## `middleware`
|
|
101
101
|
|
|
102
|
-
:read-more{to="/docs/migration/plugins-and-middleware"}
|
|
102
|
+
:read-more{to="/docs/4.x/migration/plugins-and-middleware"}
|
|
103
103
|
|
|
104
104
|
## `scrollToTop`
|
|
105
105
|
|
|
@@ -120,7 +120,7 @@ Similar to `key`, specify it within the [`definePageMeta`](/docs/4.x/api/utils/d
|
|
|
120
120
|
|
|
121
121
|
## `transition`
|
|
122
122
|
|
|
123
|
-
:read-more{to="/docs/getting-started/transitions"}
|
|
123
|
+
:read-more{to="/docs/4.x/getting-started/transitions"}
|
|
124
124
|
|
|
125
125
|
## `validate`
|
|
126
126
|
|
|
@@ -9,7 +9,7 @@ When referencing these variables within your components, you will have to use th
|
|
|
9
9
|
|
|
10
10
|
In the `server/` portion of your app, you can use [`useRuntimeConfig`](/docs/4.x/api/composables/use-runtime-config) without any import.
|
|
11
11
|
|
|
12
|
-
:read-more{to="/docs/guide/going-further/runtime-config"}
|
|
12
|
+
:read-more{to="/docs/4.x/guide/going-further/runtime-config"}
|
|
13
13
|
|
|
14
14
|
## Migration
|
|
15
15
|
|
|
@@ -25,9 +25,9 @@ export default defineNuxtConfig({
|
|
|
25
25
|
apiSecret: '123',
|
|
26
26
|
// Config within public will be also exposed to the client
|
|
27
27
|
public: {
|
|
28
|
-
apiBase: '/api'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
28
|
+
apiBase: '/api',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
31
|
})
|
|
32
32
|
```
|
|
33
33
|
|