A
A
Amenov_Abdul2019-09-11 15:20:11
Vue.js
Amenov_Abdul, 2019-09-11 15:20:11

How to make nested Vue-Router URLs?

Hey!
I ran into a problem, here is the route code:

const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/sign-in',
      name: 'sign-in',
      component: () => import('./views/auth/SignIn.vue'),
    },
    {
      path: '/',
      name: 'home',
      component: () => import('./views/Index.vue'),
    },
    {
      path: '/control-panel',
      name: 'control-panel',
      component: () => import('./views/control-panel/Index.vue'),
      children: [
        {
          path: 'users',
          name: 'control-panel.users',
          component: () => import('./views/control-panel/Users.vue')
        },
        {
          path: 'tenders',
          name: 'control-panel.tenders',
          component: () => import('./views/control-panel/Tenders.vue')
        }
      ]
    },
  ]
})


export default router

I did everything as in the documentation ... (I think so).
In general, the essence is this, a page with a URL: control-panel displays its content but its daughter. The URLs contain the same content as the parent. What's wrong? If it is not clear written, write about it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-09-11
@Amenov_Abdul

Is there router-viewinside ./views/control-panel/Index.vue?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question