VUE—打印(原生态网页打印)

//打印触发的方法
      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

posted @ 2018-11-21 14:17  瑞蚨祥qianjin  阅读(630)  评论(0编辑  收藏  举报