Web project built by vue element UI, breadcrumbs Homepage>List>Content
How to write router.js
{
path: '/index',
component: CdnLayout,
children: [
{ path: 'list', component: List, name: '列表页' },
{ path: 'list/detal', component: Detail, name: '内容'}
]
},
let matched = this.$route.matched.filter(item => item.name;
);
const first = matched[0];
if (first && (first.name !== '首页' || first.path !== '')) {
matched = [{ name: '首页', path: '/index' }].concat(matched)
}
So how do I write in this breadcrumb so that it can be displayed on the content page Home>List>Content
Thank you, waiting online