Dom-to-Image-More
安装
npm install dom-to-image-more
使用
import domtoimage from 'dom-to-image-more';
domtoimage.toPng(document.getElementById('myElement'))
.then(function(dataUrl) {
var img = new Image();
img.src = dataUrl;
document.body.appendChild(img);
});