接口对接修改
This commit is contained in:
@@ -29,13 +29,15 @@ export default {
|
||||
methods: {
|
||||
// 生成图片需要调用的方法
|
||||
generateImage(domId) {
|
||||
console.log(123);
|
||||
// 获取设备dpi
|
||||
setTimeout(() => {
|
||||
let dom = document.getElementById(domId);
|
||||
console.log(dom.offsetWidth, dom.offsetHeight);
|
||||
html2canvas(dom, {
|
||||
scale: 8,
|
||||
useCORS: true,
|
||||
width: dom.offsetWidth,
|
||||
height: dom.offsetHeight,
|
||||
}).then((canvas) => {
|
||||
// this.$refs.header.appendChild(canvas);
|
||||
const posterImg = canvas.toDataURL()
|
||||
@@ -45,7 +47,7 @@ export default {
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
}, 300);
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user