@nuxt/docs 4.1.1 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1.getting-started/03.configuration.md +1 -1
- package/1.getting-started/11.state-management.md +1 -1
- package/2.guide/2.directory-structure/1.app/1.components.md +4 -0
- package/3.api/3.utils/define-nuxt-plugin.md +1 -1
- package/3.api/5.kit/5.components.md +0 -1
- package/6.bridge/3.bridge-composition-api.md +1 -1
- package/6.bridge/6.meta.md +1 -1
- package/package.json +1 -1
|
@@ -100,7 +100,7 @@ const runtimeConfig = useRuntimeConfig()
|
|
|
100
100
|
|
|
101
101
|
## App Configuration
|
|
102
102
|
|
|
103
|
-
The `app.config.ts` file, located in the source directory (by default
|
|
103
|
+
The `app.config.ts` file, located in the source directory (by default `app/`), is used to expose public variables that can be determined at build time. Contrary to the `runtimeConfig` option, these cannot be overridden using environment variables.
|
|
104
104
|
|
|
105
105
|
A minimal configuration file exports the `defineAppConfig` function containing an object with your configuration. The `defineAppConfig` helper is globally available without import.
|
|
106
106
|
|
|
@@ -88,7 +88,7 @@ Make sure to install the Pinia module with `npx nuxt module add pinia` or follow
|
|
|
88
88
|
::
|
|
89
89
|
|
|
90
90
|
::code-group
|
|
91
|
-
```ts [stores/website.ts]
|
|
91
|
+
```ts [app/stores/website.ts]
|
|
92
92
|
export const useWebsiteStore = defineStore('websiteStore', {
|
|
93
93
|
state: () => ({
|
|
94
94
|
name: '',
|
|
@@ -133,6 +133,10 @@ Nuxt supports this using lazy (or delayed) hydration, allowing you to control wh
|
|
|
133
133
|
|
|
134
134
|
Nuxt provides a range of built-in hydration strategies. Only one strategy can be used per lazy component.
|
|
135
135
|
|
|
136
|
+
::note
|
|
137
|
+
Any prop change on a lazily hydrated component will trigger hydration immediately. (e.g., changing a prop on a component with `hydrate-never` will cause it to hydrate)
|
|
138
|
+
::
|
|
139
|
+
|
|
136
140
|
::warning
|
|
137
141
|
Currently Nuxt's built-in lazy hydration only works in single-file components (SFCs), and requires you to define the prop in the template (rather than spreading an object of props via `v-bind`). It also does not work with direct imports from `#components`.
|
|
138
142
|
::
|
|
@@ -53,7 +53,6 @@ function addComponentsDir (dir: ComponentsDir, opts: { prepend?: boolean } = {})
|
|
|
53
53
|
| `ignore` | `string[]` | `false` | Ignore patterns that will be run against specified path. |
|
|
54
54
|
| `prefix` | `string` | `false` | Prefix all matched components with this string. |
|
|
55
55
|
| `pathPrefix` | `boolean` | `false` | Prefix component name by its path. |
|
|
56
|
-
| `enabled` | `boolean` | `false` | Ignore scanning this directory if set to `true`. |
|
|
57
56
|
| `prefetch` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
|
|
58
57
|
| `preload` | `boolean` | `false` | These properties (prefetch/preload) are used in production to configure how components with Lazy prefix are handled by webpack via its magic comments. Learn more on [webpack documentation](https://webpack.js.org/api/module-methods/#magic-comments) |
|
|
59
58
|
| `isAsync` | `boolean` | `false` | This flag indicates, component should be loaded async (with a separate chunk) regardless of using Lazy prefix or not. |
|
|
@@ -113,7 +113,7 @@ export default <Plugin> function (ctx, inject) {}
|
|
|
113
113
|
While this example is valid, Nuxt 3 introduces a new defineNuxtPlugin function that has a slightly different signature.
|
|
114
114
|
::
|
|
115
115
|
|
|
116
|
-
:ReadMore{link="/docs/guide/directory-structure/plugins#creating-plugins"}
|
|
116
|
+
:ReadMore{link="/docs/guide/directory-structure/app/plugins#creating-plugins"}
|
|
117
117
|
|
|
118
118
|
### `useRouter` and `useRoute`
|
|
119
119
|
|
package/6.bridge/6.meta.md
CHANGED
|
@@ -23,7 +23,7 @@ export default defineNuxtConfig({
|
|
|
23
23
|
|
|
24
24
|
### Update head properties
|
|
25
25
|
|
|
26
|
-
In your `nuxt.config`, rename `head` to `
|
|
26
|
+
In your `nuxt.config`, rename `head` to `app.head`. (Note that objects no longer have a `hid` key for deduplication.)
|
|
27
27
|
|
|
28
28
|
::code-group
|
|
29
29
|
|