chore(ActionSheet): separate ActionSheet components and ActionSheetPlugin#2122
Merged
Conversation
Contributor
Collaborator
Author
|
/update-snapshot |
Contributor
|
⏳ 正在运行快照更新。。。 CI: Open |
commit: |
liweijie0812
approved these changes
Jan 7, 2026
Collaborator
liweijie0812
reviewed
Jan 7, 2026
2a47f63 to
7d8e271
Compare
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
fix #2121
💡 需求背景和解决方案
背景 1:按需引入时组件和函数式调用混用导致表现不一致
可复现仓库地址:https://github.com/tonny3548/test-tdesign-bugs.git
40aab98b4321597ed70eac7f295a242e.mov
问题分析:在 src/action-sheet/index.ts 中,导出的 _ActionSheet 是一个混合对象,同时具有 Vue 组件特性和函数式 API 特性。当用户按需引入 import { ActionSheet } from 'tdesign-mobile-vue' 时,由于 src/components.ts 使用了 export * from './action-sheet',这会导出所有内容,导致内联和函数式调用混用,出现表现不一致问题。
方案:分离导出组件和函数式 API
背景 2: 函数式调用控制台告警
方案:参考 Dialog,使用 reactive 包装所有 props(包括 visible: false),然后通过 Vue 的 h 函数渲染组件
📝 更新日志
break(ActionSheet): 调整导出方式,分离组件和函数式 API 的使用方式
fix(ActionSheet): 修复按需引入时组件和函数式调用混用导致表现不一致的问题
fix(ActionSheet): 修复函数式调用时控制台告警
feat(ActionSheet): 新增
ActionSheetPlugin导出,提供独立的函数式调用API本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单