element-ui的NavMenu,鼠标滑过menu在IE下,报错.Error in v-on handl
作者:互联网
在 node_modules/element-ui/lib/element-ui.common.js 补上以下代码
(function (window) {
try {
new MouseEvent('test');
return false; // No need to polyfill
} catch (e) {
// Need to polyfill - fall through
}
// Polyfills DOM4 MouseEvent
var MouseEventPolyfill = function (eventType, params) {
params = params || { bubbles: false, cancelable: false };
var mouseEvent = document.createEvent('MouseEvent');
mouseEvent.initMouseEvent(eventType,
params.bubbles,
params.cancelable,
window,
0,
params.screenX || 0,
params.screenY || 0,
params.clientX || 0,
params.clientY || 0,
params.ctrlKey || false,
params.altKey || false,
params.shiftKey || false,
params.metaKey || false,
params.button || 0,
params.relatedTarget || null
);
return mouseEvent;
}
MouseEventPolyfill.prototype = Event.prototype;
window.MouseEvent = MouseEventPolyfill;
})(window);
标签:false,handl,menu,MouseEventPolyfill,window,报错,MouseEvent,params,mouseEvent 来源: https://www.cnblogs.com/luckyShuang/p/12502048.html