Explorar o código

fix #4025 ,feat: home will be able to click

陈帅 %!s(int64=6) %!d(string=hai) anos
pai
achega
79cc60ac32
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/components/PageHeaderWrapper/breadcrumb.js

+ 4 - 0
src/components/PageHeaderWrapper/breadcrumb.js

@@ -8,6 +8,10 @@ import { urlToList } from '../_utils/pathTools';
 // Render the Breadcrumb child node
 const itemRender = (route, params, routes, paths) => {
   const last = routes.indexOf(route) === routes.length - 1;
+  // if path is home, use Link。
+  if (route.path === '/') {
+    return <Link to={paths.join('/')}>{route.breadcrumbName}</Link>;
+  }
   return last || !route.component ? (
     <span>{route.breadcrumbName}</span>
   ) : (