Match-id-29b6f4ed86399fefce4217772f64f6c7ac99d402
This commit is contained in:
commit
b5f0e3035e
|
@ -10,11 +10,14 @@ const uniqueKeyMap = new Map([
|
||||||
['Del', 'Delete'],
|
['Del', 'Delete'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const noop = () => {};
|
||||||
// 创建普通自定义事件对象实例,和原生事件对应
|
// 创建普通自定义事件对象实例,和原生事件对应
|
||||||
export function decorateNativeEvent(customEventName, nativeEvtName, nativeEvent) {
|
export function decorateNativeEvent(customEventName, nativeEvtName, nativeEvent) {
|
||||||
|
|
||||||
nativeEvent.isDefaultPrevented = () => nativeEvent.defaultPrevented;
|
nativeEvent.isDefaultPrevented = () => nativeEvent.defaultPrevented;
|
||||||
nativeEvent.isPropagationStopped = () => nativeEvent.cancelBubble;
|
nativeEvent.isPropagationStopped = () => nativeEvent.cancelBubble;
|
||||||
|
// 适配老版本事件api
|
||||||
|
nativeEvent.persist = noop;
|
||||||
|
|
||||||
// custom事件自定义属性
|
// custom事件自定义属性
|
||||||
nativeEvent.customEventName = customEventName;
|
nativeEvent.customEventName = customEventName;
|
||||||
|
|
Loading…
Reference in New Issue