📜  找不到错误路径 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:37.753000             🧑  作者: Mango

代码示例1
preloadImg(datauri) {
  const img = new Image();
  
  return new Promise((resolve) => {
    img.onload = (event) => {
      const imgElement = event.path ? event.path[0] : event.target;
      resolve(imgElement);
    };
  
    img.src = datauri;
  });
}