//打印触发的方法 print(e){ let subOutputRankPrin = document.getElementById('printcode'); var options = { format:"CODE128",displayValue:true,fontSize:18,height:100 }; if(this.selectData.length==0) { alert("亲,请记得选择打印内容0.0!"); } else { for(var i = 0;i<this.selectData.length; i++) { //条形码生成代码JsBarcode(document.getElementById(i),this.selectData[i].lotName,options); } document.body.innerHTML =subOutputRankPrin.innerHTML ; window.print(); window.location.reload(); document.body.innerHTML = oldContent; return false; }
---------------------
https://blog.csdn.net/aitcr/article/details/78828518