[Vuejs]-Detecting named view is used

0πŸ‘

βœ…

It seems I found the answer – it requires a bit of trick int he routes:

{
  path: '',
  component: 'Layout',
  children: [
    { 
      path: '',
      components: { default: SomeMainComponent },
      children: [
        { path: '' },
        { 
          path: '',
          components: { side: SideBox },
          children: [
            path: 'hello',
            component: HelloSidebox
          ]
        } 
      ]
    } 
  ]
}

That empty route {path: ''} is to prevent the next route from being displayed for the exact route match and only render SideBox component for any matching sub-routes.

Leave a comment