const routes = [
{ path: '/home', component: home },
{ path: '/detail', component: detail },
{ path: '/order', component: order },
{ path: '/', component: home }
]
watch: {
'$route' (to, from) {
const toDepth = to.path.split('/').length;
const fromDepth = from.path.split('/').length;
this.transitionName = toDepth < fromDepth ? 'slide-right' : 'slide-left'
}
}
我整个页面就一个
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
直接在组件中加transition
再设置mode为out–in