闲汪的vue学习笔记

IE11 el-menu鼠标滑过报错:Error in v-on

2020-07-08  本文已影响0人  闲汪

一、bug

IE11 el-menu鼠标滑过报错:Error in v-on handler: "TypeError: 对象不支持此操作"

二、解决

修改源码

/* eslint-disable */
(function(window) {
    try {
        new MouseEvent('test');
        return false; // No need to polyfill
    } catch (e) {
        // Need to polyfill - fall through
    }
    // Polyfills DOM4 MouseEvent
    var MouseEvent = function(eventType, params) {
        params = params || { bubbles: false, cancelable: false };
        var mouseEvent = document.createEvent('MouseEvent');
        mouseEvent.initMouseEvent(
          eventType, params.bubbles, params.cancelable, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null
        );
        return mouseEvent;
    };

    MouseEvent.prototype = Event.prototype;

    window.MouseEvent = MouseEvent;
}(window));
上一篇下一篇

猜你喜欢

热点阅读