react-component / collapse

React Collapse / Accordion
http://react-component.github.io/collapse/
MIT License
324 stars 134 forks source link

feat: 添加headerProps基于panel props自定义panel header #225

Closed RThong closed 2 years ago

RThong commented 2 years ago

我现在有个需求是需要让expandIcon接跟着header的右侧,而不是在panel的最右边。所以添加了一个headerRender的props,类似于expandIcon,它可以接收整个panel的props并返回一个ReactNode以此来最大化用户的自由度。

如果加这个属性OK的话我之后给antd那边提个pr把属性给补充上

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/collapse/D4PKoisEr5W3jp5x7v6nqo6XbWR5
✅ Preview: https://collapse-git-fork-rthong-feat-headerrender-react-component.vercel.app

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
collapse ✅ Ready (Inspect) Visit Preview Apr 24, 2022 at 7:17AM (UTC)
codecov[bot] commented 2 years ago

Codecov Report

Merging #225 (4ec105a) into master (a280779) will decrease coverage by 0.81%. The diff coverage is 90.90%.

:exclamation: Current head 4ec105a differs from pull request most recent head 85bdd20. Consider uploading reports for the commit 85bdd20 to get more accurate results

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
- Coverage   98.23%   97.41%   -0.82%     
==========================================
  Files           4        4              
  Lines         113      116       +3     
  Branches       34       37       +3     
==========================================
+ Hits          111      113       +2     
- Misses          2        3       +1     
Impacted Files Coverage Δ
src/Panel.tsx 95.00% <87.50%> (-2.30%) :arrow_down:
src/Collapse.tsx 100.00% <100.00%> (ø)

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more