소스 검색

Switch: fix input and change emission sequence

wacky6.AriesMBP 8 년 전
부모
커밋
cfe5f9eb3d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/switch/src/component.vue

+ 1 - 1
packages/switch/src/component.vue

@@ -119,8 +119,8 @@
     },
     methods: {
       handleChange(event) {
-        this.$emit('change', !this.checked ? this.onValue : this.offValue);
         this.$emit('input', !this.checked ? this.onValue : this.offValue);
+        this.$emit('change', !this.checked ? this.onValue : this.offValue);
         this.$nextTick(() => {
           // set input's checked property
           // in case parent refuses to change component's value