vue vue-router 面包屑问题?

vue+element UI 搭建的web项目,面包屑 首页>列表>内容
如何书写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)


                }

那么我在这个面包屑中如何去写才可以在内容页面 可以显示 首页>列表>内容

谢谢,在线等


喵喔喔
浏览 1109回答 1
1回答

郎朗坤

你都遍历出来了,用V-for 循环显示出来就行了啊
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript