search

Home  >  Q&A  >  body text

javascript - vue vue-router breadcrumb issue?

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

学习ing学习ing2726 days ago943

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-06-12 09:33:30

    You have already traversed it, just use V-for loop to display it

    reply
    0
  • Cancelreply