From a576267a7794279f7ca18fe70c0e0f96cb0f2057 Mon Sep 17 00:00:00 2001 From: fanxb Date: Fri, 26 Jul 2019 11:25:45 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat:=20[=E5=89=8D=E5=8F=B0]:?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E5=87=BD=E6=95=B0,=E9=98=BB=E6=AD=A2=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=86=92=E6=B3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/util/eventUtil.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 front/src/util/eventUtil.js diff --git a/front/src/util/eventUtil.js b/front/src/util/eventUtil.js new file mode 100644 index 0000000..458d0a6 --- /dev/null +++ b/front/src/util/eventUtil.js @@ -0,0 +1,11 @@ +/** + * 阻止原生/合成事件冒泡 + * @param {*} e + */ +export function stopTransfer(e) { + if (e.domEvent) { + e = e.domEvent; + } + e.nativeEvent.stopImmediatePropagation(); + e.stopPropagation(); +}