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

Feature/td search bar新增Action和onActionClick属性 #273

Merged
merged 5 commits into from
Aug 24, 2024

Conversation

Limpid-8818
Copy link
Contributor

@Limpid-8818 Limpid-8818 commented Aug 3, 2024

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

#209

💡 需求背景和解决方案

问题:Search组件不支持自定有右侧文字和文字的点击操作。

实现:在Search组件中添加以下两个属性

  • Action:String类型,表示右侧显示的文字,默认为空串,为空串时不显示,且不影响其他属性;若设置了Action属性,needCancel属性将不会起作用,不会显示取消按钮。
  • onActionClick:TDSearchBarEvent类型,表示右侧操作按钮点击后的回调,带有一个String参数,获取输入框中的文本。

实现效果:

  • 未获取焦点时:
    image
  • 获取焦点后:
    image
  • 点击右侧操作按钮后:
    image
  • 示例代码:
    image

📝 更新日志

  • fix(td_search_bar): 新增Action和onActionClick属性

  • 本条 PR 不需要纳入 Changelog

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

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

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

@tencent-adm
Copy link
Member

tencent-adm commented Aug 3, 2024

CLA assistant check
All committers have signed the CLA.

@Luozf12345 Luozf12345 merged commit 5616967 into Tencent:main Aug 24, 2024
1 of 2 checks passed
@github-actions github-actions bot mentioned this pull request Oct 15, 2024
15 tasks
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.

3 participants