I used v-if to switch, so I can use transition animation.
now the leader asked me to switch to a routing method, resulting in the invalidation of transition animation. How should I deal with this situation?
I used v-if to switch, so I can use transition animation.
now the leader asked me to switch to a routing method, resulting in the invalidation of transition animation. How should I deal with this situation?
Route transition effect should be set on the router-view of App.vue
< transtion name= "slide-fade" >
<router-link to="/"></router-link>
< transtion >
< transition: name= "transitionName" >
<router-view class="child-view"></router-view>
< / transition >
add watch:
watch: {
'$route':function(to,from){
//
const toDepth = to.path.split('/').length
const fromDepth = from.path.split('/').length
this.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
}
}
Previous: What is the matching result of the python regular expression re.compile?
Next: Does js regularly match keywords in a paragraph of text?