Vue router: Route child loads the parent component

0
 {
    path: '/designblock',
    name: 'Design Block',
    component: Design,
    children: [
      {
         path: 'title',
         component: title,
      }
    ],
  },

I have that route defined and when entering title the child route loads the component Design

<router-link to="/designblock/title" class="design-card" exact>title<router-link>

I really do not understand why this usually happens

    
asked by Josbert 21.07.2018 в 01:21
source

1 answer

0

When you have children in a route, you will always load the parent component, then find a <router-view> to load the child component.

If you do not want the Design component to load, then declare your routes like this:

{    
    path: '/designblock',
    name: 'Design Block',
   component: Design
}, 
{
    path: '/designblock/title',
    name: 'Title',
    component: title
 }
    
answered by 05.08.2018 в 03:16