umijs / plugin-layout

Umi plugin for ant-design-pro-layout build-in .
MIT License
13 stars 7 forks source link

bug不能正确获得menu信息 #3

Closed luna825 closed 4 years ago

luna825 commented 4 years ago
// umi运行时配置,routes前加路由后
export function patchRoutes({ routes }) {
  routes.unshift({
    path: '/foo',
    exact: true,
    component: require('@/extraRoutes/foo').default,
  });
}
// layout/index.tsx 中如下代码不能正确得到menu信息了
 const menus = patchMenus(getMenuDataFromRoutes(_routes[0].routes)); //  _routes[0] 已经变为新加的 /foo了
luna825 commented 4 years ago

ant-design-pro-layout中有大量的api可以避免这个问题。。。尴尬!!