问题描述
使用 html2canvas 截图时,有些边框截不出来
相关代码
完整测试代码如下
html2canvas.test {
padding: 5px 1.6mm;
}
.test-row{
border: #000 1px solid;
font-size: 0;
line-height: 0;
width: 32mm;
}
.test-row span{
display: inline-block;
border-right: #000 0.5px solid;
width: 8mm;
height: 8mm;
position: relative;
}
.test-row span.end{
display: block;
width: auto;
height: 2mm;
border-top: #000 0.5px solid;
border-bottom: #000 0.5px solid;
border-right: 0;
font-size: 12px;
text-align: right;
color: #666;
}
.test-row span.end:last-child{
display: none;
}
Capture
function capture () {
console.log('capture')
html2canvas(document.querySelector('.container')).then(canvas => {
document.body.appendChild(canvas)
})
}