From f564f6d0dcd3cdcfcee393ba65ae6c1c2c899fc6 Mon Sep 17 00:00:00 2001 From: Morphling <283893159@qq.com> Date: Sun, 23 Feb 2020 10:40:39 +0800 Subject: [PATCH] fix: nativeEvent is not a complete Event object (#1811) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- components/vc-checkbox/src/Checkbox.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/vc-checkbox/src/Checkbox.jsx b/components/vc-checkbox/src/Checkbox.jsx index ecbcff88c..adb692651 100644 --- a/components/vc-checkbox/src/Checkbox.jsx +++ b/components/vc-checkbox/src/Checkbox.jsx @@ -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; },