✨ Feat: [前台]:新增事件处理工具函数,阻止事件冒泡
This commit is contained in:
parent
89e08c569e
commit
a576267a77
11
front/src/util/eventUtil.js
Normal file
11
front/src/util/eventUtil.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* 阻止原生/合成事件冒泡
|
||||||
|
* @param {*} e
|
||||||
|
*/
|
||||||
|
export function stopTransfer(e) {
|
||||||
|
if (e.domEvent) {
|
||||||
|
e = e.domEvent;
|
||||||
|
}
|
||||||
|
e.nativeEvent.stopImmediatePropagation();
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user