有两个组件Page1和Page2,都在根目录下,路由如下:
routes: [
{
path: '/',
component: Home,
redirect: 'page1',
children: [
{
path: 'page1',
component: Page1
},
{
path: 'page2',
component: Page2
}
]
}
]
从page1跳转到page2,通过路由跳转监测,发现顺序如下:
- page2 created..
- page1 beforeDestroy..
- page2 mounted..
为什么page1 beforeDestroy会在page2 created之后?
我也遇到了这个问题,请问找到原因了吗