search

Home  >  Q&A  >  body text

javascript - vue sub-route matching rendering to top-level view layer problem

const routes = [
    { path: '/',component: strategyIndex,
        children: [
            { path: 'strategy/:id', component: strategyList },
            { path:'/details/:catid',component: strategyDetails}
        ]
    },
    {
        path:'*',
        redirect:'/'
    }
]

I want to render the components of the routing article details page matched by /details/:catid in the top layer of router-view. However, since it is a sub-route, it can only be rendered in the second layer of router-view. Is there any way to do this? solve?

世界只因有你世界只因有你2799 days ago509

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:45:03

    Then why don’t you extract it and put it in the first layer of routing

    reply
    0
  • Cancelreply