SOURCE

console 命令行工具 X clear

                    
>
console
<div id="container">
    <img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6b1cc5df12814b50bf9e8187fbb00aae~tplv-k3u1fbpfcp-watermark.image" />
</div>

<script>
let dom = document.getElementById('container')

function toCanvas () {
    html2canvas(dom, { scale: 4, allowTaint: true, useCORS: true }).then(res => {
            console.log(res)
            res.toDataURL('image/jpeg', 1.0)
        })

}

toCanvas()
</script>