实现方案1
通过打开新窗口的方式打印图片
function printNewWindow(imgSrc) {
let oWin = window.open('', 'pringwindow', 'menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width=1000,height=660')
oWin.document.fn = function() {
if (oWin) {
oWin.print()
oWin.close()
}
}
let html = '' + `
关注
打赏
立即登录/注册


微信扫码登录