ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

[Feature Request] Support icon in breadcrumb item overlay

Open meteorlxy opened this issue 2 years ago • 1 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

https://github.com/vueComponent/ant-design-vue/blob/3003d67c4f537c39c58b135e6103e0572f5f3b6f/components/breadcrumb/Breadcrumb.tsx#L92-L109

When using itemRender to put an icon into the breadcrumb-item, it would also be put inside menu-item of the overlay. As the #icon slot of menu-item is not available in #itemRender scope, the icon style is not correct.

What does the proposed API look like?

I'm not sure how to design the API, but I think we could at least provide a isOverlay arg for itemRender slotProps, so that users could avoid rendering the icon in overlay.

{itemRender({
  route: child,
  params,
  routes,
  paths: addChildPath(tempPaths, child.path, params),
  isOverlay: true,    //  <---- here
})}

--- update

I realized that the isOverlay could be determined by slotProps.routes.includes(slotProps.route), so it might not be necessary.

meteorlxy avatar Jun 24 '22 08:06 meteorlxy

you can also use slotProps.route.children && slotProps.route.children.length

tangjinzhou avatar Jun 25 '22 01:06 tangjinzhou

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Aug 24 '22 03:08 github-actions[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 01 '23 00:09 github-actions[bot]