Skip to content

Commit

Permalink
fix(switch): 改变v-model值后需点击两次才能改变switch状态问题修复 (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
LoopZhou authored Jan 15, 2024
1 parent ef7fc08 commit fa9ec8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/switch/switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export default defineComponent({
if (disabled.value || props.loading) {
return;
}
toggle();
if (state.value === innerValue.value) {
toggle();
}
innerValue.value = state.value;
}
return {
Expand Down

0 comments on commit fa9ec8d

Please sign in to comment.