react-component / menu

React Menu
https://menu.react-component.now.sh/
MIT License
682 stars 248 forks source link

feat: support extra option #734

Closed coding-ice closed 3 months ago

coding-ice commented 3 months ago

https://github.com/ant-design/ant-design/issues/49127

coding-ice commented 3 months ago

@afc163 佬,有空review一下~

coding-ice commented 3 months ago

给extra加了一个cls选中它,不然css好像都会有点问题,因为都能自定义传入Node

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.59%. Comparing base (526a924) to head (8eedde2). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #734 +/- ## ======================================= Coverage 99.59% 99.59% ======================================= Files 27 27 Lines 734 736 +2 Branches 200 202 +2 ======================================= + Hits 731 733 +2 Misses 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

afc163 commented 3 months ago
items={[{
  label: <><span>内容</span><span>内容</span><>,
  extra: 'extra',
}]}

这种情况好像渲染还是会不太对。

coding-ice commented 3 months ago

原来是justify-content: space-between,已经改为margin-left: auto了,extra的左边距让它自适应,应该就可以避免这个问题了,效果图如下:

image image
afc163 commented 3 months ago

哦,还有 README 里要补一下文档。