-
Notifications
You must be signed in to change notification settings - Fork 313
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
[Dropdown 下拉菜单] 添加菜单展开/收起的回调 #2989
Comments
👋 @jrainlau,感谢给 TDesign 提出了 issue。 |
加个 interface Props {
onTrigger?: (action: 'show' | 'hide') => void
} |
|
不好,和一般的常见语义冲突了。这里没有 value 的,来个这个给我看第一眼的话很奇怪,像是什么受控属性了。 不过这么一说或许可以加 |
如果一定要加的话 建议就和select一样暴露一个onPopupVisibleChange,不过现在的popupProps透传事件也可以满足这个需求,就是多了一层 |
那回头要加的话按照统一的规则来吧。@jrainlau 你可以先使用上面说的 popupProps 来解决你现在的问题。 |
* feat(breadcrumb): add tooltipprops re #2989 * chore: update snapshot --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
好的,感谢~!
YiJie ***@***.***> 于2024年7月11日周四 16:33写道:
… 如果一定要加的话
建议就和select一样暴露一个onPopupVisibleChange,不过现在的popupProps透传事件也可以满足这个需求,就是多了一层
***@***.*** <https://github.com/jrainlau> 你可以先使用上面说的
popupProps 来解决你现在的问题。
—
Reply to this email directly, view it on GitHub
<#2989 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC434RAAKN5YI7645VBKCPDZLY7OPAVCNFSM6AAAAABKWLJI62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRSGM2DOMZXGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
这个功能解决了什么问题
在自定义下拉框内容的场景中,很多时候需要知晓菜单的展开/收起时机,以便实现对应的逻辑。举个例子:
![image](https://private-user-images.githubusercontent.com/12172868/347717559-ba73525a-bc44-433b-84fb-ec6646c43454.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2OTcxNDksIm5iZiI6MTcyNDY5Njg0OSwicGF0aCI6Ii8xMjE3Mjg2OC8zNDc3MTc1NTktYmE3MzUyNWEtYmM0NC00MzNiLTg0ZmItZWM2NjQ2YzQzNDU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI2VDE4MjcyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1NWVlNmMwNTgzODUxZWZhZjUyOTg5YjAxMGVmMzkyZTgxMGQ0MmIyYTAyMjNhZDZmNWY4NDYyNzJiYTdmMDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.t_tQLt8tSpe1h95kJZKwL7G6iJtuqv6ZYFut7fFbMdI)
类似这种菜单的功能,为了优化性能,我希望在完成全部的勾选项,关闭菜单后,才触发一次后台请求。现在没有展开/收起的回调,我只能操作一个就往后台发一次请求。
你建议的方案是什么
给 添加
onShow
和onHide
回调,分别在展示菜单、关闭菜单时触发。The text was updated successfully, but these errors were encountered: