Replies: 3 comments 1 reply
|
刚刚自测运行时 layout 配置 menuDataRender 可以解决?但好麻烦,请问有更好的解决方案吗? |
0 replies
|
参考 layout 对 icon 支持的实现 export function patchRoutes({ routes }) {
Object.keys(routes).forEach(key => {
const { icon } = routes[key];
if (icon && typeof icon === 'string') {
const upperIcon = formatIcon(icon);
if (icons[upperIcon] || icons[upperIcon + 'Outlined']) {
routes[key].icon = React.createElement(icons[upperIcon] || icons[upperIcon + 'Outlined']);
}
}
});
}自己在 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
在 umi max 中配置 routes 时如何使用自定义 icon?
All reactions