fix: nativeEvent is not a complete Event object (#1811)

* fix: nativeEvent is not a complete Event object

The Spread syntax is only get own property of a Object,but many properties of Event is on it's prototypes chains, so the result is that the passed nativeEvent only has two property: isTrutsed  and shiftKey

* fix semicolon
This commit is contained in:
Morphling 2020-02-23 10:40:39 +08:00 committed by GitHub
parent a47b2bfc6e
commit f564f6d0dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,7 @@ export default {
this.sChecked = e.target.checked;
}
this.$forceUpdate(); // change
e.shiftKey = this.eventShiftKey;
this.__emit('change', {
target: {
...props,
@ -88,7 +89,7 @@ export default {
preventDefault() {
e.preventDefault();
},
nativeEvent: { ...e, shiftKey: this.eventShiftKey },
nativeEvent: e,
});
this.eventShiftKey = false;
},