Skip to content
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

feat(drawer): 传入 confirmBtnPropscancelButtonProps 可分别自定义按钮 #2416

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

peng-yin
Copy link
Contributor

@peng-yin peng-yin commented Aug 2, 2023

传入 confirmBtnPropscancelButtonProps 可分别自定义按钮

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#2407

💡 需求背景和解决方案

📝 更新日志

  • feat(Drawer): 传入 confirmBtnPropscancelButtonProps 可分别自定义确定按钮和取消按钮的 props。

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@@ -9,12 +9,14 @@ className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
attach | String / Function | - | 抽屉挂载的节点,默认挂在组件本身的位置。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`AttachNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
body | TNode | - | 抽屉内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
cancelBtn | TNode | - | 取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本,值类型为 Object 则表示透传 Button 组件属性。使用 TNode 自定义按钮时,需自行控制取消事件。TS 类型:`FooterButton` | N
cancelBtn | TNode | - | 取消按钮,可自定义。值为 null 则不显示取消按钮。值类型为字符串,则表示自定义按钮文本。使用 TNode 自定义按钮时,需自行控制取消事件。TS 类型:`FooterButton` | N
cancelBtnProps | ButtonProps | - | [Button API Documents](./button?tab=api)。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/drawer/type.ts) | N
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue的意思是cancelBtn没有支持Object类型 不需要增加API

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我是这样认为的, cancelBtn如果支持Object类型的话, 会使代码冗余,增加判断条件, 而且参数也不语义化, 所以cancelButton 的props 应该和 cancelButton TNode分开

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里主要有两个问题 一个是这个要录到API平台来统一管理 一个是目前1.0版本的设计是这样子 涉及类似设计的组件比较多 不能单独为这一个组件改动API 这样和其他组件也不是很一致了 所以会比较希望这种大优化放在2.0版本然后一起调整一下 同步在这里下

@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2023

失败

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants