更换贺报下载的方法9

This commit is contained in:
xuxingjun
2024-12-25 17:45:51 +08:00
parent 0f44179953
commit 30f42c3a3c

View File

@@ -182,9 +182,9 @@ export default {
console.log(2222);
// 使用 html2canvas 捕获图像,并等待其完成
const canvas = await html2canvas(domElement, {
width: domElement.offsetWidth,
height: domElement.offsetHeight,
const canvas = await html2canvas(this.$refs.generateImg, {
width: this.$refs.generateImg.offsetWidth,
height: this.$refs.generateImg.offsetHeight,
backgroundColor: '#fff',
scale: 1,
dpi: 300
@@ -248,7 +248,7 @@ export default {
},
close() {
this.$emit('child-colse', '1')
this.$refs.generateImg = '';
this.$refs.generateImg = null;
}
}
}