Skip to content

Commit

Permalink
delete duplicated logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin Betancourt authored and Edwin Betancourt committed May 22, 2020
1 parent cbc90a5 commit d3f62b3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/switch/src/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@
},
watch: {
checked() {
if (this.$refs.input) {
this.$refs.input.checked = this.checked;
}
this.$refs.input.checked = this.checked;
if (this.activeColor || this.inactiveColor) {
this.setBackgroundColor();
}
Expand All @@ -136,7 +134,6 @@
this.$nextTick(() => {
// set input's checked property
// in case parent refuses to change component's value
this.$refs.input.checked = this.checked;
if (this.$refs.input) {
this.$refs.input.checked = this.checked;
}
Expand Down

0 comments on commit d3f62b3

Please sign in to comment.