Skip to content

Commit f564f6d

Browse files
authored
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
1 parent a47b2bf commit f564f6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/vc-checkbox/src/Checkbox.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export default {
7777
this.sChecked = e.target.checked;
7878
}
7979
this.$forceUpdate(); // change前,维持现有状态
80+
e.shiftKey = this.eventShiftKey;
8081
this.__emit('change', {
8182
target: {
8283
...props,
@@ -88,7 +89,7 @@ export default {
8889
preventDefault() {
8990
e.preventDefault();
9091
},
91-
nativeEvent: { ...e, shiftKey: this.eventShiftKey },
92+
nativeEvent: e,
9293
});
9394
this.eventShiftKey = false;
9495
},

0 commit comments

Comments
 (0)