-
Notifications
You must be signed in to change notification settings - Fork 284
fix(switch): 简化props使用 #3132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(switch): 简化props使用 #3132
Conversation
Walkthrough本次修改针对 Switch 组件的事件处理逻辑进行了调整,统一了对 onChange 回调的引用方式。从之前通过 props.onChange 调用改为直接使用解构后的 onChange,从而使代码更加简洁和易于维护。此变更适用于 taro 版和标准 tsx 版组件,且导出或公共实体的声明保持不变。 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant S as Switch 组件
participant C as onChange 回调
U->>S: 触发点击事件
S->>S: 执行 onClick 处理逻辑
S->>S: 检查 onChange 是否存在
S->>C: 调用 onChange(!value)
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (2)
✨ 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:
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 ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3132 +/- ##
==========================================
Coverage 86.97% 86.97%
==========================================
Files 280 280
Lines 18484 18484
Branches 2791 2792 +1
==========================================
Hits 16077 16077
Misses 2402 2402
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit