Skip to content

Commit 20574aa

Browse files
committed
docs: use meta.transition
1 parent 9fa2c9a commit 20574aa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/docs/guide/advanced/transitions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const routes = [
3939
```html
4040
<router-view v-slot="{ Component, route }">
4141
<!-- Use any custom transition and to `fade` -->
42-
<transition :name="route.meta.transitionName || 'fade'">
42+
<transition :name="route.meta.transition || 'fade'">
4343
<component :is="Component" />
4444
</transition>
4545
</router-view>
@@ -52,7 +52,7 @@ It is also possible to determine the transition to use dynamically based on the
5252
```html
5353
<!-- use a dynamic transition name -->
5454
<router-view v-slot="{ Component, route }">
55-
<transition :name="route.meta.transitionName">
55+
<transition :name="route.meta.transition">
5656
<component :is="Component" />
5757
</transition>
5858
</router-view>
@@ -64,7 +64,7 @@ We can add an [after navigation hook](./navigation-guards.md#global-after-hooks)
6464
router.afterEach((to, from) => {
6565
const toDepth = to.path.split('/').length
6666
const fromDepth = from.path.split('/').length
67-
to.meta.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
67+
to.meta.transition = toDepth < fromDepth ? 'slide-right' : 'slide-left'
6868
})
6969
```
7070

packages/docs/zh/guide/advanced/transitions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const routes = [
3939
```html
4040
<router-view v-slot="{ Component, route }">
4141
<!-- 使用任何自定义过渡和回退到 `fade` -->
42-
<transition :name="route.meta.transitionName || 'fade'">
42+
<transition :name="route.meta.transition || 'fade'">
4343
<component :is="Component" />
4444
</transition>
4545
</router-view>
@@ -52,7 +52,7 @@ const routes = [
5252
```html
5353
<!-- 使用动态过渡名称 -->
5454
<router-view v-slot="{ Component, route }">
55-
<transition :name="route.meta.transitionName">
55+
<transition :name="route.meta.transition">
5656
<component :is="Component" />
5757
</transition>
5858
</router-view>
@@ -64,7 +64,7 @@ const routes = [
6464
router.afterEach((to, from) => {
6565
const toDepth = to.path.split('/').length
6666
const fromDepth = from.path.split('/').length
67-
to.meta.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
67+
to.meta.transition = toDepth < fromDepth ? 'slide-right' : 'slide-left'
6868
})
6969
```
7070

0 commit comments

Comments
 (0)