Skip to content

fix: uploader上传组件taro版本h5端支持文件选择#3424

Open
13373239979 wants to merge 3 commits intojdf2e:nextfrom
13373239979:feature_uploader-support-file
Open

fix: uploader上传组件taro版本h5端支持文件选择#3424
13373239979 wants to merge 3 commits intojdf2e:nextfrom
13373239979:feature_uploader-support-file

Conversation

@13373239979
Copy link

🤔 这个变动的性质是?

  • 新特性提交
  • [✅] 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

升级NutUI时,Taro版本编译为H5端上传组件无法支持文件类型的选择,排查问题后是Taro底层chooseImageAPI根据小程序的规范,无法支持这一能力。

💡 需求背景和解决方案

1.Taro版本上传组件在H5端支持文件类型选择
2、针对web环境封装chooseFileAPI,不再依赖于TaroAPI
3、不涉及UI改动

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

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

  • [ ✅] 文档已补充或无须补充
  • [ ✅] 代码演示已提供或无须提供
  • [ ✅] TypeScript 定义已补充或无须补充
  • [ ✅] fork仓库代码是否为最新避免文件冲突
  • [ ✅] Files changed 没有 package.json lock 等无关文件

@github-actions github-actions bot added the action:review This PR needs more reviews (less than 2 approvals) label Mar 5, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • dev-harmony
  • feat_v3.x

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 14d6ec34-acc1-4993-9086-28b10524b8f4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the 2.x Target branch 2.x label Mar 5, 2026
}
if (Taro.getEnv() === 'WEB') {
const el = document.getElementById('taroChooseImage')
const el = document.getElementById('taroChooseFile')
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个判断可以加一条限制:比如是否使用 自定义上传功能 类似这样的属性,
目标是:即满足原 taro 的上传逻辑、保障规范的一致性;又可以满足自定义上传逻辑。

Copy link
Collaborator

@xiaoyatong xiaoyatong left a comment

Choose a reason for hiding this comment

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

可以增加一个属性,用于是否自定义上传,以区别taro规范。
需要补充文档、demo和单测~~

}
if (Taro.getEnv() === 'WEB') {
const el = document.getElementById('taroChooseImage')
if (Taro.getEnv() === 'WEB' && needchooseFile) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

改为驼峰~

Copy link
Collaborator

@xiaoyatong xiaoyatong left a comment

Choose a reason for hiding this comment

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

变量使用驼峰方式~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.x Target branch 2.x action:review This PR needs more reviews (less than 2 approvals) size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants