📅  最后修改于: 2022-03-11 15:00:37.753000             🧑  作者: Mango
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;
});
}