美文网首页闲汪的vue学习笔记
IE11 el-menu鼠标滑过报错:Error in v-on

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

作者: 闲汪 | 来源:发表于2020-07-08 17:47 被阅读0次

    一、bug

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

    二、解决

    修改源码

    • 目录 node_modules\element-ui\lib\element-ui.common.js
    /* 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));
    

    相关文章

      网友评论

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

        本文链接:https://www.haomeiwen.com/subject/bhaccktx.html