Skip to content

Commit

Permalink
evaluate if exists this.$refs.input in watch checked
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 e3b195b commit cbc90a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/switch/src/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@
},
watch: {
checked() {
this.$refs.input.checked = this.checked;
if (this.$refs.input) {
this.$refs.input.checked = this.checked;
}
if (this.activeColor || this.inactiveColor) {
this.setBackgroundColor();
}
Expand Down

0 comments on commit cbc90a5

Please sign in to comment.