将完整的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 { 100%; height: calc(100vh - 220px); } }