Switch: fix input and change emission sequence

This commit is contained in:
wacky6.AriesMBP
2017-08-05 01:41:31 +10:00
committed by 杨奕
parent 1ba66276c3
commit cfe5f9eb3d

View File

@@ -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