Closed Wxh16144 closed 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
upload | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 30, 2024 9:59am |
此次更改涉及 AjaxUploader
组件,新增了一个 name
属性到组件的 props 中,并在渲染的 <input>
元素中包含该属性。这一修改增强了 AjaxUploader
的功能,使其能够为文件输入指定 name
属性,从而支持表单提交并改善与各种表单处理库的集成。同时,相关的 GitHub 问题也得到了关注。
文件 | 更改摘要 |
---|---|
src/AjaxUploader.tsx | 添加 name 属性到 AjaxUploader 组件的 props 中,并在 <input> 元素中使用该属性。 |
tests/uploader.spec.tsx | 新增测试用例,验证 Upload 组件渲染的输入元素的 name 属性是否正确设置。 |
在草地上跳跃的小兔,
新增name
属性真是不错!
文件上传更顺畅,
表单处理不再愁,
兔子欢呼,舞动小脚丫,
让我们一起庆祝这变化! 🐰✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.84%. Comparing base (
99cdc3e
) to head (a360a6c
). Report is 1 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
等等,这好像和 https://github.com/react-component/upload/pull/574 是一样的?
这个逻辑貌似也没错。
等等,这好像和 #574 是一样的?
相比之下就少删除一个默认值 name: 'file',
相比之下就少删除一个默认值 name: 'file',
yes, 上一个 PR 把 name 透传 + 删除默认值(以为没用到,直接删除了,并且测试用例也没拦截到)
后面发现有问题,就 revert了,并且提了一个 pr 将 name 默认值的测试用例补了一下。
然后再回过头来解决 name 透传问题。
将最上游的 name 属性透传给 input 标签。( 不确定是否是最好的结局方案 :(
Summary by CodeRabbit
新功能
AjaxUploader
组件中添加了name
属性,增强了文件输入的功能,便于表单提交和与各种表单处理库的集成。测试
Upload
组件渲染的输入元素的name
属性是否正确设置。