@nuxt/docs-nightly 4.4.3-29594048.ac9e25b8 → 4.4.3-29618876.1bd346ee
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/3.guide/2.best-practices/performance.md +4 -1
- package/3.guide/4.modules/3.recipes-basics.md +19 -0
- package/4.api/1.components/14.nuxt-announcer.md +1 -1
- package/4.api/2.composables/use-announcer.md +1 -1
- package/4.api/3.utils/define-page-meta.md +1 -1
- package/5.community/6.roadmap.md +0 -2
- package/package.json +1 -1
|
@@ -290,6 +290,25 @@ function setup () {
|
|
|
290
290
|
```
|
|
291
291
|
::
|
|
292
292
|
|
|
293
|
+
## Add Route Middleware
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
import { addRouteMiddleware, createResolver, defineNuxtModule } from '@nuxt/kit'
|
|
297
|
+
|
|
298
|
+
export default defineNuxtModule({
|
|
299
|
+
setup (options, nuxt) {
|
|
300
|
+
const resolver = createResolver(import.meta.url)
|
|
301
|
+
|
|
302
|
+
// example to add a global route middleware
|
|
303
|
+
addRouteMiddleware({
|
|
304
|
+
global: true,
|
|
305
|
+
name: 'name-of-your-middleware',
|
|
306
|
+
path: resolver.resolve('./runtime/middleware/name-of-your-middleware'),
|
|
307
|
+
})
|
|
308
|
+
},
|
|
309
|
+
})
|
|
310
|
+
```
|
|
311
|
+
|
|
293
312
|
## Add Server Routes
|
|
294
313
|
|
|
295
314
|
```ts
|
|
@@ -151,7 +151,7 @@ interface PageMeta {
|
|
|
151
151
|
|
|
152
152
|
- **Type**: `boolean | (to: RouteLocationNormalized, from: RouteLocationNormalized) => boolean`
|
|
153
153
|
|
|
154
|
-
Tell Nuxt to scroll to the top before rendering the page or not. If you want to overwrite the default scroll behavior of Nuxt, you can do so in `~/router.options.ts` (see [custom routing](/docs/4.x/guide/recipes/custom-routing#using-routeroptions)) for more info.
|
|
154
|
+
Tell Nuxt to scroll to the top before rendering the page or not. Navigation is independent from rendering, so scroll behavior is always triggered even when the page doesn't re-render (e.g. when using a fixed [`key`](/docs/4.x/api/utils/define-page-meta#key)). Set `scrollToTop: false` to disable scrolling in such cases. If you want to overwrite the default scroll behavior of Nuxt, you can do so in `~/router.options.ts` (see [custom routing](/docs/4.x/guide/recipes/custom-routing#using-routeroptions)) for more info.
|
|
155
155
|
|
|
156
156
|
**`[key: string]`**
|
|
157
157
|
|
package/5.community/6.roadmap.md
CHANGED
|
@@ -40,10 +40,8 @@ In addition to the Nuxt framework, there are modules that are vital for the ecos
|
|
|
40
40
|
|
|
41
41
|
| Module | Status | Nuxt Support | Repository | Description |
|
|
42
42
|
|----------------------------------------|--------------|--------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
43
|
-
| [Scripts](https://scripts.nuxt.com) | Public Beta | 3.x, 4.x | [nuxt/scripts](https://github.com/nuxt/scripts) | Easy 3rd party script management. |
|
|
44
43
|
| Auth Utils | Planned | 4.x, 5.x | `nuxt/auth-utils` to be announced | The temporary repository [atinux/nuxt-auth-utils](https://github.com/atinux/nuxt-auth-utils) is available while awaiting its official integration into Nuxt via RFC. |
|
|
45
44
|
| [a11y](https://github.com/nuxt/a11y) | Public Alpha | 3.x, 4.x | [nuxt/a11y](https://github.com/nuxt/a11y). | Real-time accessibility feedback and automated testing in your browser during development (see [nuxt/nuxt#23255](https://github.com/nuxt/nuxt/issues/23255)). |
|
|
46
|
-
| [Hints](https://github.com/nuxt/hints) | Public Alpha | 4.x, 5.x | [nuxt/hints](https://github.com/nuxt/hints) | Guidance and suggestions for enhancing development practices. |
|
|
47
45
|
|
|
48
46
|
## Release Cycle
|
|
49
47
|
|