diff --git a/packages/switch/src/component.vue b/packages/switch/src/component.vue index 88c5483ee..b853023f3 100644 --- a/packages/switch/src/component.vue +++ b/packages/switch/src/component.vue @@ -134,7 +134,9 @@ 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; + } }); }, setBackgroundColor() {