printJS({
printable: "repair",
type:'html',
// header:"打印",
style:"@page {margin:2.4cm 2cm ;resolution: 300dpi;}",
onPrintDialogClose: this.erexcel=false,
targetStyles: ["*"], // 使用dom的所有样式,很重要
//解决字体样式失效的问题
font_size: '',
})
主要生效的代码为:font_size: '',因为在print-js源码中默认对样式进行了处理,因此这样可以使字体的样式重新生效