diff --git a/docs/content/1.getting-started/5.routing.md b/docs/content/1.getting-started/5.routing.md index 9a6badce37e..3f8d2773453 100644 --- a/docs/content/1.getting-started/5.routing.md +++ b/docs/content/1.getting-started/5.routing.md @@ -126,8 +126,6 @@ The `validate` property accepts the `route` as an argument. You can return a boo If you have a more complex use case, then you can use anonymous route middleware instead. -:StabilityEdge - ```vue [pages/post/[id].vue] ``` - - Or globally in the `nuxt.config`: ```ts [nuxt.config.ts] @@ -371,7 +369,7 @@ const next = computed(() => '/' + (id.value + 1))
- ⬅️ | + ⬅️ | ➡️
diff --git a/docs/content/2.guide/2.directory-structure/1.components.md b/docs/content/2.guide/2.directory-structure/1.components.md index 9e959c11ce7..6149e8b7d2f 100644 --- a/docs/content/2.guide/2.directory-structure/1.components.md +++ b/docs/content/2.guide/2.directory-structure/1.components.md @@ -225,6 +225,8 @@ This feature only works with Nuxt auto-imports and `#components` imports. Explic ## `` Component +:StabilityEdge + Nuxt provides the `` component to render a component only during development. The content will not be included in production builds and tree-shaken. diff --git a/docs/content/3.api/3.utils/define-page-meta.md b/docs/content/3.api/3.utils/define-page-meta.md index 5811ef763d3..bc5297862bf 100644 --- a/docs/content/3.api/3.utils/define-page-meta.md +++ b/docs/content/3.api/3.utils/define-page-meta.md @@ -47,7 +47,7 @@ interface PageMeta { **`alias`** - **Type**: `string | string[]` - + Aliases for the record. Allows defining extra paths that will behave like a copy of the record. Allows having paths shorthands like `/users/:id` and `/u/:id`. All `alias` and `path` values must share the same params. **`keepalive`** @@ -81,9 +81,9 @@ interface PageMeta { Define anonymous or named middleware directly within `definePageMeta`. Learn more about [route middleware](/guide/directory-structure/middleware). **`pageTransition`** - + - **Type**: `boolean` | [`TransitionProps`](https://vuejs.org/api/built-in-components.html#transition) - + Set name of the transition to apply for current page. You can also set this value to `false` to disable the page transition. **`redirect`** @@ -92,16 +92,12 @@ interface PageMeta { Where to redirect if the route is directly matched. The redirection happens before any navigation guard and triggers a new navigation with the new target location. - :StabilityEdge - **`validate`** - **Type**: `(route: RouteLocationNormalized) => boolean | Promise | Partial | Promise>` Validate whether a given route can validly be rendered with this page. Return true if it is valid, or false if not. If another match can't be found, this will mean a 404. You can also directly return an object with `statusCode`/`statusMessage` to respond immediately with an error (other matches will not be checked). - :StabilityEdge - **`[key: string]`** - **Type**: `any` @@ -143,18 +139,18 @@ The example below shows how the middleware can be defined using a `function` dir middleware: [ function (to, from) { const auth = useState('auth') - + if (!auth.value.authenticated) { return navigateTo('/login') } - + return navigateTo('/checkout') } ], // ... or a string middleware: 'auth' - + // ... or multiple strings middleware: ['auth', 'another-named-middleware'] }) @@ -170,7 +166,7 @@ You can define the layout that matches the layout's file name located (by defaul definePageMeta({ // set custom layout layout: 'admin' - + // ... or disable a default layout layout: false }) diff --git a/docs/content/7.migration/7.component-options.md b/docs/content/7.migration/7.component-options.md index 15fbedd864b..13abbfcb431 100644 --- a/docs/content/7.migration/7.component-options.md +++ b/docs/content/7.migration/7.component-options.md @@ -114,8 +114,6 @@ See [layout migration](/migration/pages-and-layouts). The validate hook in Nuxt 3 only accepts a single argument, the `route`. Just as in Nuxt 2, you can return a boolean value. If you return false and another match can't be found, this will mean a 404. You can also directly return an object with `statusCode`/`statusMessage` to respond immediately with an error (other matches will not be checked). -:StabilityEdge - ```diff [pages/users/[id].vue] -