由于ie浏览器不兼容,导致页面数据渲染不出来:

对象不支持find属性或方法

 

 

ie浏览器不兼容find写法,在引用的公共方法中添加兼容代码,如下:

/*兼容处理 低版本IE*/
//
Array.prototype.find || (Array.prototype.find = function (predicate) { 
    if (this == null) {
      throw new TypeError('Array.prototype.find called on null or undefined');
    }
    if (typeof predicate !== 'function') {
      throw new TypeError('predicate must be a function');
    }
    var list = Object(this);
    var length = list.length || 0;
    var thisArg = arguments[1];
    var value;

    for (var i = 0; i < length; i++) {
      value = list[i];
      if (predicate.call(thisArg, value, i, list)) {
        return value;
      }
    }
    return null;
})

 

相关文章:

  • 2021-06-03
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2021-12-20
  • 2022-12-23
  • 2018-04-02
  • 2021-08-23
相关资源
相似解决方案