samturrell / vue-breadcrumbs

Breadcrumbs for Vue.js
MIT License
146 stars 27 forks source link

Problem with / url #20

Closed bpuig closed 5 years ago

bpuig commented 5 years ago

Hello, I've just installed this component and found myself with an issue. I'm using routes like this (Copilot style):

export default new Router({
    mode: 'history',
    linkActiveClass: 'is-active',
    routes: [
        {path: '/login', component: Login, meta: {auth: false}},
        {
            path: '/',
            component: DefaultLayout,
            meta: {breadcrumb: 'Inicio'},
            children: [
                {path: 'dashboard', name: 'dashboard', component: Dashboard, meta: {auth: true, breadcrumb: 'Dashboard'}},             
            ]
        },
    ]
})

And in result, my breadcrumb shows Inicio > Dashboard But both urls point to /dashboard. If I have 3 breadcrumb levels, 2nd and 3rd are ok, but 1st points to 3rd. 1st > 2nd > 3rd 1st will point to 3rd path. very weird.

Thanks for your time

bpuig commented 5 years ago

Ok, I solved it. I was missing the tag name in path: '/', This works:

 {
            path: '/',
            component: DefaultLayout,
            name: 'Home',
            meta: {breadcrumb: 'Inicio'},
            children: [....