⾯包屑 利⽤$route.matched可得到路由匹配数组,按顺序解析可得路由层次关系。
发布日期:2021-05-07 06:42:56 浏览次数:21 分类:原创文章

本文共 207 字,大约阅读时间需要 1 分钟。

// Breadcrumb.vuewatch: {    $route() {    // [{name:'home',path:'/'},{name:'list',path:'/list'}] console.log(this.$route.matched); // ['home','list'] this.crumbData = this.$route.matched.map(m => m.name) }}
上一篇:自己实现低配版vue-router
下一篇:vue-router动态添加路由,利⽤$router.addRoutes()常⽤于⽤户权限控制

发表评论

最新留言

很好
[***.229.124.182]2025年03月17日 14时24分39秒