problem description
recently need to do a sharing function, native app embedded h5 page, intercept the current page as a sharing cover.
uses html2canvas, to capture screenshots in the computer simulator. There is no problem, but only part of the screenshot can be captured on the real machine
related pictures
- original page
- pc
the environmental background of the problems and what methods you have tried
has been searching the Internet for a long time, which may be the reason why the layout uses positioning, but even if positioning is not needed, it is still incomplete
related codes
const dom = this.$refs.container
html2canvas(dom, {
useCORS: true,
foreignObjectRendering: true
}).then(canvas => {
const base64 = canvas.toDataURL("image/jpeg")
// upload base64 ... return url
})