M
M
Maxim2020-05-09 20:09:43
Vue.js
Maxim, 2020-05-09 20:09:43

How to route vuejs correctly?

Tell me how to properly organize the route, I have something wrong here))) if I switch to the news, the component is not loaded

{
            path: '/contragents',
            name: 'contragents',
            meta: {layout: 'main'},
            component: () => import('./view/Farm/Contragents/Contragents')
        },
        {
            path: '/contragents/:id',
            meta: {layout: 'main'},
            props: true,
            children: [
                {
                    path: '/',
                    name: 'contragent',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/Contragent'),
                },
                {
                    path: 'news',
                    name: 'contragent.news',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/News')
                },
                {
                    path: 'categories',
                    name: 'contragent.categories',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/Category')
                },
                {
                    path: 'cargo',
                    name: 'contragent.cargo',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/Cargo')
                },
                {
                    path: 'group',
                    name: 'contragent.group',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/Group')
                },
                {
                    path: '/section',
                    name: 'contragent.section',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/Section')
                },
                {
                    path: '/transport',
                    name: 'contragent.transport',
                    meta: {layout: 'main'},
                    component: () => import('./view/Farm/Contragents/Transport')
                },
            ]
        },

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question