Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从服务端请求菜单,一级菜单icon生效,二级菜单不生效 #10178

Closed
yangyangdg opened this issue Aug 27, 2022 · 11 comments
Closed

Comments

@yangyangdg
Copy link

bug重现:
1、后端路由定义:
image
2、路由映射icon:
image
3、运行效果:
image

@pkaq
Copy link
Contributor

pkaq commented Aug 28, 2022

image
用到的icon要挨个引入映射

@yangda666
Copy link

bug重现: 1、后端路由定义: image 2、路由映射icon: image 3、运行效果: image

这个代码有问题 对于2级菜单icon你没有映射到

@yangyangdg
Copy link
Author

肯定映射到了啊,没映射到我还来提issues干嘛,没看到我已经写了console.log('menuData',menuData)吗,确认过了已经映射

bug重现: 1、后端路由定义: image 2、路由映射icon: image 3、运行效果: image

这个代码有问题 对于2级菜单icon你没有映射到

肯定映射到了啊,没映射到我还来提issues干嘛,没看到我已经写了console.log('menuData',menuData)吗,确认过了已经映射

@yangyangdg
Copy link
Author

已经映射

@mushroomlb
Copy link

一直不支持,官方demo也没有

@Mankvis
Copy link

Mankvis commented Aug 30, 2022

请问解决了吗

@yangda666
Copy link

官网提的有子菜单项的render方法可以重写下: subMenuItemRender
截屏2022-08-30 08 27 16

@Mankvis
Copy link

Mankvis commented Aug 30, 2022

官网提的有子菜单项的render方法可以重写下: subMenuItemRender 截屏2022-08-30 08 27 16

大佬这个有demo代码吗

@djfyaci
Copy link

djfyaci commented Aug 30, 2022

// 二级icon
menuItemRender: (menuItemProps, defaultDom) => {
  if (menuItemProps.isUrl || !menuItemProps.path) {
    return defaultDom;
  }
  return (
    <Link to={menuItemProps.path}>
      {menuItemProps.pro_layout_parentKeys &&
        menuItemProps.pro_layout_parentKeys.length > 0 &&
        menuItemProps.icon}
      {defaultDom}
    </Link>
  );
},

@yangyangdg
Copy link
Author

// 二级icon
menuItemRender: (menuItemProps, defaultDom) => {
  if (menuItemProps.isUrl || !menuItemProps.path) {
    return defaultDom;
  }
  return (
    <Link to={menuItemProps.path}>
      {menuItemProps.pro_layout_parentKeys &&
        menuItemProps.pro_layout_parentKeys.length > 0 &&
        menuItemProps.icon}
      {defaultDom}
    </Link>
  );
},

谢谢大佬,这样写可以解决这个二级菜单图标不显示问题!!

@Libuke5115
Copy link

http://t.csdnimg.cn/5KpDG 可以看看这篇文章
Uploading 57035f75928a49c298bfe76e0bf6a450.png…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants