Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当路由有多层嵌套,动画出现了异常 #7

Open
yellowSTA opened this issue Jun 25, 2018 · 1 comment
Open

当路由有多层嵌套,动画出现了异常 #7

yellowSTA opened this issue Jun 25, 2018 · 1 comment

Comments

@yellowSTA
Copy link

export default new Router({
routes: [
{
path: '/',
redirect: '/index'
},
{
path: '/index',
component: index,
children: [
{
path: '',
name: 'home',
component: home
},
{
path: 'page1',
name: 'page1',
component: page1
},
{
path: 'page2',
component: page2,
children: [
{
path: '',
name: 'setting',
component: setting
},
{
path: 'page3',
name: 'page3',
component: page3
}
]
}
]
}
]
})

进入page2的子路由,动画明显和其他不一样

@zhengguorong
Copy link
Owner

zhengguorong commented Jun 29, 2018

如果你子路由没有用PageTransition包裹,是不会有动画的,你可以这样写

routes: [
    {
      path: '/',
      name: 'PageTransition',
      component: PageTransition,
      children: [{
        path: '',
        component: Index
      }, {
        path: '/pageA',
        component: PageTransition, // 这里对pageA的子路由做一层包裹
        children: [
          {
            path: '',
            component: PageA
          },
          {
            path: 'pageC',
            component: PageC
          }
        ]
      }, {
        path: '/pageB',
        component: PageB
      }]
    }
  ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants