html解决方案 CDX 2020-09-20 293 阅读1分钟 img 图片加载的方法,加载成功和加载失败方法 const img = new Image() const _this = this // 图片加载成功 img.onload = el => {} // 图片加载失败 img.onerror = el => { } img.src = url