vue的router 存在 多层

routes: [

    {
        path: '/', component: Main,
        children: [
            {
                path: '/help_document',
                component: Help_Document,
            },
            //我的任务-所有工作流
            {
                path: 'work', component: Work_Main,
                children: [
                    {
                        path: 'task',
                        component: Work_MyTask
                    },
                    {
                        path: 'release',
                        component: Work_MyRelease
                    }
              }
      }
   ] 
   

以上是router的设置!
在Main的vue中有一个 <router-view></router-view>
在Work_Main中 也存在一个 <router-view></router-view>

实际操作: ‘/help_document’ 路径下 第一次跳转 ‘work/release’ (渲染没有问题);

       'work/release'跳转到 ‘work/task’ (渲染没有问题);
       “work/task”  跳转到 ‘/help_document’ ;以上渲染都没有问题.

但是: 再次从 ‘/help_document’ 路径下 跳转 ‘work/release’,

       浏览器地址栏地址显示正确,渲染出来的画面却是 ‘work/task’中的内容.
       
       求大神解答?
       
          
              
阅读 2.6k
2 个回答
新手上路,请多包涵

楼主问题解决了吗

<keep-alive>导致的!

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题