fix: 修复 wd-upload 组件的 formData 属性的 ts 类型为 void 的问题 - #1106
Conversation
✅ Deploy Preview for wot-design-uni ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次变更修正了 Changes
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
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 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
📒 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
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
formData属性的默认值,确保其正确返回空对象。