dom生成图片代码
npm install dom-to-image
//ios
domtoimage.toSvg(container, {
width: parseInt(5000),
height: parseInt(5000)
}).then(function (data) {
that.nextStep(data);
})
.catch(function (error) {
console.error('生成失败', error);
});
//android
domtoimage.toJpeg(container, {
width: parseInt(containerWidth),
height: parseInt(containerHeight),
scale: 2
}).then(function (data) {
that.nextStep(data);
})
.catch(function (error) {
console.error('生成失败', error);
});