为了账号安全,请及时绑定邮箱和手机立即绑定

vue路由动画问题

vue路由动画问题

叮当猫咪 2018-11-14 13:14:25
<template>     <transition :name="transitionName">       <router-view></router-view>     </transition></template>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'         }       }我整个页面就一个<router-view></router-view>,是不是无法实现路由切换的时候让即将消失路由从左边消失,即将进来的路由从右边进来?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 539 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信