this.$nextTick(() => {
// 使用$nextTick,解决数据还没有渲染到html就先转为图片,此时的图片会是空内容的问题
// var canvas2 = document.createElement('canvas');
// const _canvas = document.getElementById('downloadCardDiv');
// var w = parseInt(window.getComputedStyle(_canvas).width);
// var h = parseInt(window.getComputedStyle(_canvas).height);
// var w = _canvas.offsetWidth;
// var h = _canvas.offsetHeight;
const canvas = document.createElement('canvas') // 创建一个canvas节点
const shareContent = document.getElementById('downloadCardDiv') // 需要截图的
html2canvas生成的图片偏移问题
最新推荐文章于 2024-07-03 16:51:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)