Explorar o código

Switch: fix input and change emission sequence

wacky6.AriesMBP %!s(int64=8) %!d(string=hai) anos
pai
achega
cfe5f9eb3d
Modificáronse 1 ficheiros con 1 adicións e 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