Repository navigation
fix(Dropdown): restore onClick option type - #6959
Merged
Merged
Conversation
dvd233
requested review from
Cat1007,
PengYYYYY,
Wesley-0808,
chaishi,
liweijie0812,
uyarn,
zhangpaopao0609 and
zydemail
as code owners
September 9, 2026 02:33
Collaborator
TDesign Component Site Preview Open
|
commit: |
uyarn
approved these changes
Sep 16, 2026
6 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 的性质是?
🔗 相关 Issue
Fixes #6958
💡 需求背景和解决方案
从 1.20.6 起,
TdDropdownProps.onClick的首参被收窄为TdDropdownItemProps['value'],导致官方示例中读取data.content时出现 TS18048 / TS2339。实际运行时仍通过handleMenuClick向顶层 Dropdown 回调传递完整的DropdownOption,中英文 API 文档以及tdesign-api中的源定义也都保持该契约。本 PR:
TdDropdownProps.onClick的首参恢复为DropdownOption;TdDropdownItemProps.onClick当前接收 value 的契约,不扩大修复范围;content和value,从而让类型和实际 payload 再次不一致时直接失败。tdesign-api的 canonical Dropdown 定义当前已经是DropdownOption,因此无需额外修改 API 仓库。📝 更新日志
tdesign-vue-next
onClick回调参数类型与运行时不一致的问题@tdesign-vue-next/chat
@tdesign-vue-next/nuxt
@tdesign-vue-next/auto-import-resolver
☑️ 请求合并前的自查清单
🧪 自测说明
handleMenuClick与props.onClick均传递完整DropdownOption,通过。git diff --check与签名提交验证通过。tsc,交由 CI 做完整验证。