Skip to content

Commit

Permalink
fix: 修复路由meta.transition.name配置无效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Sep 18, 2023
1 parent 0fcc12a commit 984bddb
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/layout/components/appMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,20 @@ const getSectionStyle = computed(() => {
const transitionMain = defineComponent({
render() {
const transitionName =
transitions.value(this.route)?.name || "fade-transform";
const enterTransition = transitions.value(this.route)?.enterTransition;
const leaveTransition = transitions.value(this.route)?.leaveTransition;
return h(
Transition,
{
name:
transitions.value(this.route) &&
this.route.meta.transition.enterTransition
? "pure-classes-transition"
: (transitions.value(this.route) &&
this.route.meta.transition.name) ||
"fade-transform",
enterActiveClass:
transitions.value(this.route) &&
`animate__animated ${this.route.meta.transition.enterTransition}`,
leaveActiveClass:
transitions.value(this.route) &&
`animate__animated ${this.route.meta.transition.leaveTransition}`,
name: enterTransition ? "pure-classes-transition" : transitionName,
enterActiveClass: enterTransition
? `animate__animated ${enterTransition}`
: undefined,
leaveActiveClass: leaveTransition
? `animate__animated ${leaveTransition}`
: undefined,
mode: "out-in",
appear: true
},
Expand Down

1 comment on commit 984bddb

@xiaoxian521
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.