Skip to content

fix(form): 修复表单示例中 switch 组件无法切换的问题 (#7636) - #7763

Merged
jinmao88 merged 1 commit into
vbenjs:mainfrom
RanGuMo:main
Apr 2, 2026
Merged

jinmao88 merged 1 commit into
vbenjs:mainfrom
RanGuMo:main

Conversation

@RanGuMo

@RanGuMo RanGuMo commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

修复表单示例中 switch 组件无法切换的问题。在 /examples/form/merge 和 /examples/form/scroll-to-error-test 两个页面中,switch 组件的切换功能失效,无法正常改变状态。

问题原因:switch 组件的 [modelValue]绑定不正确,导致状态无法更新。通过修正绑定逻辑,确保 switch 状态能够正确响应用户操作。

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to 'pnpm-lock.yaml' unless you introduce a new test example.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes
    • Updated form example components to maintain compatibility with the current version of Ant Design Vue.

@changeset-bot

changeset-bot Bot commented Apr 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b1932a5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Two Ant Design Vue Switch component bindings in form examples are updated from generic v-model syntax to the named model prop syntax v-model:checked, ensuring proper two-way data binding with the component's checked state.

Changes

Cohort / File(s) Summary
Ant Design Vue Switch Binding Updates
playground/src/views/examples/form/merge.vue, playground/src/views/examples/form/scroll-to-error-test.vue
Updated Switch component v-model bindings to use the named checked prop syntax (v-model:checked) instead of generic v-model for proper state synchronization with Ant Design Vue's Switch component.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly Related PRs

Suggested Reviewers

  • anncwb
  • vince292007
  • mynetfan
  • jinmao88

Poem

🐰 Switches flip with proper grace,
v-model:checked finds its place,
Two-way binding now so true,
Form examples shiny new! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing a switch component toggle issue in form examples by updating model bindings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is mostly complete with a clear bug description, proper type of change selection, and completed checklist items, though some checklist items appear optimistic given the scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@jinmao88
jinmao88 merged commit 128a131 into vbenjs:main Apr 2, 2026
16 of 18 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants