소스 검색

Switch: fix toggling value error (#19473)

Co-authored-by: Edwin Betancourt <EdwinBetanc0urt@hotmail.com>
Edwin Betancourt 3 년 전
부모
커밋
473ef53f93
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      packages/switch/src/component.vue

+ 3 - 1
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() {