基于iframe实现打印


将完整的html打印成pdf

需要的插件:vue-print-nb

具体使用方法:

 <iframe
  id="frames"
  class="iframe-template"
  :src="htmlSrc"
  frameborder="0"
  style="border:0px;"
></iframe>
<c-button type="primary" v-print="'#frames'">打印</c-button>

printObj: { id: "frames", popTitle:"标题", standdard: "HTML", extraCss: this.htmlSrc, extraHead:'<meta http-equiv="Content-Language"content="zh-cn"/>' } //一定全局定义样式 @media print { //打印的样式 #frames { width: 100%; height: calc(100vh - 220px); } }

  

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM