低版本浏览器报错Object.fromEntries is not a function

ckeditor谷歌68报错 Object.fromEntries is not a function

解决方法1:

npm i polyfill-object.fromentries

在入口文件中引入:import ‘polyfill-object.fromentries’

解决方法2:

在build\cdeditor.js中加入以下代码:

Object.fromEntries = function fromEntries (iterable) {
    
    
    return [...iterable].reduce((obj, [key, val]) => {
    
    
        obj[key] = val;
        return obj;
    }, {
    
    });
};

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43485503/article/details/130268355