在项目PC端项目调起打印机。
onPrint = () => { window.document.body.innerHTML = window.document.getElementById(‘printHTML’)?.innerHTML
window.print()
window.location.reload()
}
这里就是需要打印的内容
<Row style={{ width: ‘100%’ }}>
<Button style={{ margin: ‘0 20px’ }} onClick={onCancel} >
关闭
< Button style={{ marginRight: ‘20px’ }}type=“primary” onClick={this.onPrint}> 打印
PC端调起打印机
最新推荐文章于 2024-07-17 20:19:26 发布