@nuxt/docs-nightly 4.0.0-29128580.259cbe7f → 4.0.0-29129113.94c86b9b
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.
|
@@ -171,8 +171,8 @@ Name | Config File | How To
|
|
|
171
171
|
|
|
172
172
|
If you need to pass options to `@vitejs/plugin-vue` or `@vitejs/plugin-vue-jsx`, you can do this in your `nuxt.config` file.
|
|
173
173
|
|
|
174
|
-
- `vite.vue` for `@vitejs/plugin-vue`. Check available options
|
|
175
|
-
- `vite.vueJsx` for `@vitejs/plugin-vue-jsx`. Check available options
|
|
174
|
+
- `vite.vue` for `@vitejs/plugin-vue`. Check [available options](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
|
|
175
|
+
- `vite.vueJsx` for `@vitejs/plugin-vue-jsx`. Check [available options](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx).
|
|
176
176
|
|
|
177
177
|
```ts twoslash [nuxt.config.ts]
|
|
178
178
|
export default defineNuxtConfig({
|
|
@@ -145,7 +145,7 @@ useHead({
|
|
|
145
145
|
})
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
Nuxt uses `unhead` under the hood, and you can refer to its full documentation
|
|
148
|
+
Nuxt uses `unhead` under the hood, and you can refer to [its full documentation](https://unhead.unjs.io).
|
|
149
149
|
|
|
150
150
|
### Modifying The Rendered Head With A Nitro Plugin
|
|
151
151
|
|
|
@@ -280,7 +280,7 @@ mockNuxtImport('useStorage', () => {
|
|
|
280
280
|
```
|
|
281
281
|
|
|
282
282
|
::note
|
|
283
|
-
`mockNuxtImport` can only be used once per mocked import per test file. It is actually a macro that gets transformed to `vi.mock` and `vi.mock` is hoisted, as described [
|
|
283
|
+
`mockNuxtImport` can only be used once per mocked import per test file. It is actually a macro that gets transformed to `vi.mock` and `vi.mock` is hoisted, as described [in the Vitest docs](https://vitest.dev/api/vi.html#vi-mock).
|
|
284
284
|
::
|
|
285
285
|
|
|
286
286
|
If you need to mock a Nuxt import and provide different implementations between tests, you can do it by creating and exposing your mocks using [`vi.hoisted`](https://vitest.dev/api/vi.html#vi-hoisted), and then use those mocks in `mockNuxtImport`. You then have access to the mocked imports, and can change the implementation between tests. Be careful to [restore mocks](https://vitest.dev/api/mock.html#mockrestore) before or after each test to undo mock state changes between runs.
|
|
@@ -299,13 +299,13 @@ Of course, you are welcome to define metadata for your own use throughout your a
|
|
|
299
299
|
|
|
300
300
|
#### `alias`
|
|
301
301
|
|
|
302
|
-
You can define page aliases. They allow you to access the same page from different paths. It can be either a string or an array of strings as defined [
|
|
302
|
+
You can define page aliases. They allow you to access the same page from different paths. It can be either a string or an array of strings as defined [in the vue-router documentation](https://router.vuejs.org/guide/essentials/redirect-and-alias.html#Alias).
|
|
303
303
|
|
|
304
304
|
#### `keepalive`
|
|
305
305
|
|
|
306
306
|
Nuxt will automatically wrap your page in [the Vue `<KeepAlive>` component](https://vuejs.org/guide/built-ins/keep-alive.html#keepalive) if you set `keepalive: true` in your `definePageMeta`. This might be useful to do, for example, in a parent route that has dynamic child routes, if you want to preserve page state across route changes.
|
|
307
307
|
|
|
308
|
-
When your goal is to preserve state for parent routes use this syntax: `<NuxtPage keepalive />`. You can also set props to be passed to `<KeepAlive>` (see a full list
|
|
308
|
+
When your goal is to preserve state for parent routes use this syntax: `<NuxtPage keepalive />`. You can also set props to be passed to `<KeepAlive>` (see [a full list](https://vuejs.org/api/built-in-components.html#keepalive)).
|
|
309
309
|
|
|
310
310
|
You can set a default value for this property [in your `nuxt.config`](/docs/api/nuxt-config#keepalive).
|
|
311
311
|
|
|
@@ -319,7 +319,7 @@ You can define the layout used to render the route. This can be either false (to
|
|
|
319
319
|
|
|
320
320
|
#### `layoutTransition` and `pageTransition`
|
|
321
321
|
|
|
322
|
-
You can define transition properties for the `<transition>` component that wraps your pages and layouts, or pass `false` to disable the `<transition>` wrapper for that route. You can see a list of options that can be passed
|
|
322
|
+
You can define transition properties for the `<transition>` component that wraps your pages and layouts, or pass `false` to disable the `<transition>` wrapper for that route. You can see [a list of options that can be passed](https://vuejs.org/api/built-in-components.html#transition) or read [more about how transitions work](https://vuejs.org/guide/built-ins/transition.html#transition).
|
|
323
323
|
|
|
324
324
|
You can set default values for these properties [in your `nuxt.config`](/docs/api/nuxt-config#layouttransition).
|
|
325
325
|
|