Skip to content

fix: 修复 wd-upload 组件的 formData 属性的 ts 类型为 void 的问题 - #1106

Merged
Moonofweisheng merged 1 commit into
Moonofweisheng:masterfrom
quantum-rose:fix/wd-upload/form-data
Jun 13, 2025
Merged

fix: 修复 wd-upload 组件的 formData 属性的 ts 类型为 void 的问题#1106
Moonofweisheng merged 1 commit into
Moonofweisheng:masterfrom
quantum-rose:fix/wd-upload/form-data

Conversation

@quantum-rose

@quantum-rose quantum-rose commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

🤔 这个 PR 的性质是?(至少选择一个)

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • Bug Fixes
    • 修正上传组件中 formData 属性的默认值,确保其正确返回空对象。

@netlify

netlify Bot commented Jun 11, 2025

Copy link
Copy Markdown

Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7784f23
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/68492c5c69eb9500084efa62
😎 Deploy Preview https://deploy-preview-1106--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jun 11, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2025 7:13am

@coderabbitai

coderabbitai Bot commented Jun 11, 2025

Copy link
Copy Markdown

Walkthrough

本次变更修正了 uploadProps 对象中 formData 属性的默认值,将其从未正确返回对象的写法调整为显式返回空对象,确保默认值为 {} 而不是 undefined

Changes

文件路径 变更摘要
src/uni_modules/wot-design-uni/components/wd-upload/types.ts 修正 formData 默认值的函数写法,确保返回空对象

Poem

小兔敲键盘,代码悄悄改,
空对象归位,默认不再猜。
细节虽微小,上传更可靠,
晴空一片蓝,开发心情好!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.18%. Comparing base (1938d92) to head (7784f23).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (1938d92) and HEAD (7784f23). Click for more details.

HEAD has 510 uploads less than BASE
Flag BASE (1938d92) HEAD (7784f23)
h5 256 1
wd-resize 3 0
wd-sidebar 3 0
wd-steps 3 0
wd-drop-menu 3 0
wd-loadmore 3 0
wd-number-keyboard 3 0
wd-tabs 1 0
wd-progress 3 0
wd-badge 3 0
wd-picker-view 3 0
wd-sticky 3 0
wd-rate 3 0
wd-swiper 3 0
wd-select-picker 3 0
wd-table 3 0
wd-segmented 3 0
wd-count-to 3 0
wd-sticky-box 3 0
wd-toast 3 0
wd-signature 3 0
wd-swipe-action 3 0
wd-sort-button 3 0
wd-message-box 3 0
wd-gap 3 0
wd-notify 3 0
wd-radio 3 0
wd-navbar-capsule 3 0
wd-search 3 0
wd-input 3 0
wd-tooltip 3 0
wd-pagination 3 0
wd-fab 3 0
wd-navbar 3 0
wd-textarea 3 0
wd-img-cropper 3 0
wd-grid 3 0
wd-status-tip 3 0
wd-index-bar 3 0
wd-overlay 3 0
wd-tag 3 0
wd-circle 3 0
wd-video-preview 3 0
wd-card 3 0
wd-cell 3 0
wd-picker 3 0
wd-notice-bar 3 0
wd-upload 3 1
wd-keyboard 3 0
wd-slider 3 0
wd-form 3 0
wd-datetime-picker-view 3 0
wd-action-sheet 3 0
wd-tabbar 3 0
wd-curtain 3 0
wd-input-number 3 0
wd-checkbox 3 0
wd-radio-group 3 0
wd-backtop 3 0
wd-layout 3 0
wd-loading 3 0
wd-swiper-nav 3 0
wd-collapse 3 0
wd-grid-item 3 0
wd-divider 3 0
wd-step 3 0
wd-calendar-view 3 0
wd-col-picker 3 0
wd-password-input 3 0
wd-popup 3 0
wd-switch 3 0
wd-cell-group 3 0
wd-datetime-picker 3 0
wd-config-provider 3 0
wd-calendar 3 0
wd-transition 3 0
wd-text 3 0
wd-icon 3 0
wd-index-anchor 3 0
wd-count-down 3 0
wd-button 3 0
wd-watermark 3 0
wd-popover 3 0
wd-checkbox-group 3 0
wd-skeleton 3 0
wd-floating-panel 3 0
wd-img 3 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1106       +/-   ##
===========================================
- Coverage   84.94%   52.18%   -32.77%     
===========================================
  Files         215       11      -204     
  Lines       17191      962    -16229     
  Branches     2707       94     -2613     
===========================================
- Hits        14603      502    -14101     
+ Misses       2588      460     -2128     
Flag Coverage Δ
h5 52.18% <100.00%> (-32.77%) ⬇️
wd-action-sheet ?
wd-backtop ?
wd-badge ?
wd-button ?
wd-calendar ?
wd-calendar-view ?
wd-card ?
wd-cell ?
wd-cell-group ?
wd-checkbox ?
wd-checkbox-group ?
wd-circle ?
wd-col-picker ?
wd-collapse ?
wd-config-provider ?
wd-count-down ?
wd-count-to ?
wd-curtain ?
wd-datetime-picker ?
wd-datetime-picker-view ?
wd-divider ?
wd-drop-menu ?
wd-fab ?
wd-floating-panel ?
wd-form ?
wd-gap ?
wd-grid ?
wd-grid-item ?
wd-icon ?
wd-img ?
wd-img-cropper ?
wd-index-anchor ?
wd-index-bar ?
wd-input ?
wd-input-number ?
wd-keyboard ?
wd-layout ?
wd-loading ?
wd-loadmore ?
wd-message-box ?
wd-navbar ?
wd-navbar-capsule ?
wd-notice-bar ?
wd-notify ?
wd-number-keyboard ?
wd-overlay ?
wd-pagination ?
wd-password-input ?
wd-picker ?
wd-picker-view ?
wd-popover ?
wd-popup ?
wd-progress ?
wd-radio ?
wd-radio-group ?
wd-rate ?
wd-resize ?
wd-search ?
wd-segmented ?
wd-select-picker ?
wd-sidebar ?
wd-signature ?
wd-skeleton ?
wd-slider ?
wd-sort-button ?
wd-status-tip ?
wd-step ?
wd-steps ?
wd-sticky ?
wd-sticky-box ?
wd-swipe-action ?
wd-swiper ?
wd-swiper-nav ?
wd-switch ?
wd-tabbar ?
wd-table ?
wd-tabs ?
wd-tag ?
wd-text ?
wd-textarea ?
wd-toast ?
wd-tooltip ?
wd-transition ?
wd-upload 52.18% <100.00%> (ø)
wd-video-preview ?
wd-watermark ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/uni_modules/wot-design-uni/components/wd-upload/types.ts (1)

218-218: 建议显式标注 default 函数的返回类型

default: () => ({}) 能够修复原本返回 undefined 的问题👍。
为了让 TypeScript 推断到 UploadFormData 而不是一般的 {},可再显式声明返回类型,使后续对 formData 的访问获得完整类型提示。

-  formData: { type: Object as PropType<UploadFormData>, default: () => ({}) },
+  formData: {
+    type: Object as PropType<UploadFormData>,
+    default: (): UploadFormData => ({})
+  },

[建议改进]

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1938d92 and 7784f23.

📒 Files selected for processing (1)
  • src/uni_modules/wot-design-uni/components/wd-upload/types.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - wot-design-uni
  • GitHub Check: ESLint Check
  • GitHub Check: Header rules - wot-design-uni
  • GitHub Check: Pages changed - wot-design-uni

@Moonofweisheng
Moonofweisheng merged commit 6026137 into Moonofweisheng:master Jun 13, 2025
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