Skip to content

Commit d3f62b3

Browse files
Edwin BetancourtEdwin Betancourt
authored andcommitted
delete duplicated logic.
1 parent cbc90a5 commit d3f62b3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/switch/src/component.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@
117117
},
118118
watch: {
119119
checked() {
120-
if (this.$refs.input) {
121-
this.$refs.input.checked = this.checked;
122-
}
120+
this.$refs.input.checked = this.checked;
123121
if (this.activeColor || this.inactiveColor) {
124122
this.setBackgroundColor();
125123
}
@@ -136,7 +134,6 @@
136134
this.$nextTick(() => {
137135
// set input's checked property
138136
// in case parent refuses to change component's value
139-
this.$refs.input.checked = this.checked;
140137
if (this.$refs.input) {
141138
this.$refs.input.checked = this.checked;
142139
}

0 commit comments

Comments
 (0)