Match-id-29b6f4ed86399fefce4217772f64f6c7ac99d402

This commit is contained in:
* 2022-03-10 17:37:26 +08:00 committed by *
commit b5f0e3035e
1 changed files with 3 additions and 0 deletions

View File

@ -10,11 +10,14 @@ const uniqueKeyMap = new Map([
['Del', 'Delete'],
]);
const noop = () => {};
// 创建普通自定义事件对象实例,和原生事件对应
export function decorateNativeEvent(customEventName, nativeEvtName, nativeEvent) {
nativeEvent.isDefaultPrevented = () => nativeEvent.defaultPrevented;
nativeEvent.isPropagationStopped = () => nativeEvent.cancelBubble;
// 适配老版本事件api
nativeEvent.persist = noop;
// custom事件自定义属性
nativeEvent.customEventName = customEventName;