Browse Source

恢复面包屑组件

develop
zq 1 month ago
parent
commit
16e13800de
  1. 106
      packages/Breadcrumb/src/index.vue

106
packages/Breadcrumb/src/index.vue

@ -37,67 +37,67 @@ export default {
}, },
computed: { computed: {
breadcrumbs() { breadcrumbs() {
// if (this.$route.meta.hideBreadcrumb) return []; if (this.$route.meta.hideBreadcrumb) return [];
const crumbs = [ const crumbs = [
{ // {
path:{ // path:{
path:'/', // path:'/',
query:{uid: "2300"}, // query:{uid: "2300"},
params:{} // params:{}
}, // },
title:'首页' // title:''
}, // },
{ // {
path:{ // path:{
path: "/agent/siteList", // path: "/agent/siteList",
query:{uid: "2300"}, // query:{uid: "2300"},
params:{} // params:{}
}, // },
title:"站点列表" // title:""
}, // },
]; ];
// let currentRoute = this.$route; let currentRoute = this.$route;
// // //
// while (currentRoute) { while (currentRoute) {
// // //
// // const matchedRoute = this.$router.options.routes.find( // const matchedRoute = this.$router.options.routes.find(
// // r => r.name === currentRoute.name // r => r.name === currentRoute.name
// // ); // );
// // //
// const routeWithParams = { const routeWithParams = {
// path: currentRoute.path, path: currentRoute.path,
// query: currentRoute.query, query: currentRoute.query,
// params: currentRoute.params params: currentRoute.params
// }; };
// crumbs.unshift({ crumbs.unshift({
// path: routeWithParams, path: routeWithParams,
// title: this.getTitle(currentRoute) title: this.getTitle(currentRoute)
// }); });
// // meta.breadcrumbParent // meta.breadcrumbParent
// if (currentRoute.meta.breadcrumbParent) { if (currentRoute.meta.breadcrumbParent) {
// currentRoute = this.$router.options.routes.find( currentRoute = this.$router.options.routes.find(
// r => r.name === currentRoute.meta.breadcrumbParent r => r.name === currentRoute.meta.breadcrumbParent
// ); );
// // $route // $route
// if (currentRoute) { if (currentRoute) {
// currentRoute = { currentRoute = {
// ...currentRoute, ...currentRoute,
// path: currentRoute.path, path: currentRoute.path,
// query: this.$route.query, // query: this.$route.query, //
// params: this.$route.params, // params: this.$route.params, //
// meta: currentRoute.meta || {} meta: currentRoute.meta || {}
// }; };
// } }
// } else { } else {
// currentRoute = null; currentRoute = null;
// } }
// } }
return crumbs; return crumbs;
}, },

Loading…
Cancel
Save