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(); +}