Jelajahi Sumber

Switch: fix input and change emission sequence

wacky6.AriesMBP 8 tahun lalu
induk
melakukan
cfe5f9eb3d
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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