From cbc90a5e86cfa552a826541fe4a910cfb7d2f816 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Fri, 22 May 2020 16:02:09 -0400 Subject: [PATCH] evaluate if exists this.$refs.input in watch checked --- packages/switch/src/component.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/switch/src/component.vue b/packages/switch/src/component.vue index c707b13c90..6861b760b9 100644 --- a/packages/switch/src/component.vue +++ b/packages/switch/src/component.vue @@ -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(); }