Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
docs: update stability edge banners
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 26, 2022
1 parent b010e3e commit ac9efb2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
2 changes: 0 additions & 2 deletions docs/content/1.getting-started/5.routing.md
Expand Up @@ -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]
<script setup>
definePageMeta({
Expand Down
6 changes: 2 additions & 4 deletions docs/content/1.getting-started/5.transitions.md
Expand Up @@ -236,7 +236,7 @@ export default defineNuxtConfig({
layoutTransition: {
name: 'slide',
mode: 'out-in' // default
}
}
}
})
```
Expand Down Expand Up @@ -271,8 +271,6 @@ definePageMeta({
</script>
```

<!-- Remove this example in next RC: ::StabilityEdge -->

Or globally in the `nuxt.config`:

```ts [nuxt.config.ts]
Expand Down Expand Up @@ -371,7 +369,7 @@ const next = computed(() => '/' + (id.value + 1))
<div>
<slot />
<div v-if="$route.params.id">
<NuxtLink :to="prev">⬅️</NuxtLink> |
<NuxtLink :to="prev">⬅️</NuxtLink> |
<NuxtLink :to="next">➡️</NuxtLink>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions docs/content/2.guide/2.directory-structure/1.components.md
Expand Up @@ -225,6 +225,8 @@ This feature only works with Nuxt auto-imports and `#components` imports. Explic

## `<DevOnly>` Component

:StabilityEdge

Nuxt provides the `<DevOnly>` component to render a component only during development.

The content will not be included in production builds and tree-shaken.
Expand Down
18 changes: 7 additions & 11 deletions docs/content/3.api/3.utils/define-page-meta.md
Expand Up @@ -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`**
Expand Down Expand Up @@ -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`**
Expand All @@ -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<boolean> | Partial<NuxtError> | Promise<Partial<NuxtError>>`

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`
Expand Down Expand Up @@ -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']
})
Expand All @@ -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
})
Expand Down
2 changes: 0 additions & 2 deletions docs/content/7.migration/7.component-options.md
Expand Up @@ -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]
- <script>
- export default {
Expand Down

0 comments on commit ac9efb2

Please sign in to comment.