Sfoglia il codice sorgente

fix: 面包屑点击

wzyyy 3 anni fa
parent
commit
b745166c08
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      src/app.tsx

+ 9 - 1
src/app.tsx

@@ -226,7 +226,7 @@ const MenuItemIcon = (
 
 
 // ProLayout 支持的api https://procomponents.ant.design/components/layout
 // ProLayout 支持的api https://procomponents.ant.design/components/layout
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {
-  console.log({ ...initialState });
+  // console.log({ ...initialState });
   return {
   return {
     navTheme: 'light',
     navTheme: 'light',
     headerTheme: 'light',
     headerTheme: 'light',
@@ -235,6 +235,14 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
     waterMarkProps: {
     waterMarkProps: {
       // content: initialState?.currentUser?.name,
       // content: initialState?.currentUser?.name,
     },
     },
+    itemRender: (route, _, routes) => {
+      const chilck = routes.indexOf(route) > 1;
+      return chilck && route.path !== '/iot/rule-engine/Alarm' ? (
+        <Link to={route.path}>{route.breadcrumbName}</Link>
+      ) : (
+        <span>{route.breadcrumbName}</span>
+      );
+    },
     footerRender: () => <Footer />,
     footerRender: () => <Footer />,
     onPageChange: () => {
     onPageChange: () => {
       const { location } = history;
       const { location } = history;