Explorar el Código

Switch: fix input and change emission sequence

wacky6.AriesMBP hace 8 años
padre
commit
cfe5f9eb3d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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