feat: headerActionIcons 支持细粒度配置 & 修复异步渲染导致无法获取实例的问题 #2301
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👀 PR includes
✨ Feature
🐛 Bugfix
📝 Description
headerActionIcons 支持细粒度配置
当同一个单元格配置了多个 icon 时, 为了区分是哪个 icon , 第二参数传入了 iconName, 那么在 icon 很多的场景
尤其是配置了
defaultHide
,displayConditions
,onClick
之类的动态展示场景,写法比较繁琐.现在修改为, 支持单个 icon 粒度的 hook
单个 icon 粒度的hook 优先级 > 所有 icon 的 hook, 这样可以满足对所有 icon 统一控制 和单独控制的场景诉求
修复异步渲染导致无法获取实例的问题
改为异步渲染后, 原先通过
useEffect
转发 ref 的方式不可用了S2/packages/s2-react/src/hooks/useSpreadSheet.ts
Lines 64 to 74 in f26904a
统一为
context
分发的方式, 修复下钻/编辑表 等场景报错的问题🖼️ Screenshot
🔗 Related issue link
🔍 Self-Check before the merge