html转pdf/vue中导出pdf

2021-03-11 10:35

阅读:291

标签:nload   联系   beef   -o   into   center   let   ble   mat   

一,组件,需要转pdf下载的的html

二,引入组件

"faceResult" ref="fnFaceChild">


import FACEORDER from ./faceOrder.vue    //引入组件


data中this.faceResult 


调用后台接口获取显示数据

 fnFacePrint(index, row) {
      console.log(row)
      let orderSn = row.orderSn;
      this.loading = true;
      fnGetOutFacePrint(orderSn)
        .then(res => {
          this.loading = false;
          console.log(res);
          if (res.code == 200) {
            this.faceResult = res.data;
            this.$refs.fnFaceChild.fnGetOrderSn(res.data.orderSn);
            document.querySelector(#faceCtx).style.left = 20px;
            document.querySelector(#faceCtx).style.minHeight = 800px;
            setTimeout( () => {
              //导出PDF
              console.log(this.faceResult)
              htmlToPdf.downloadPDF( document.querySelector(#faceCtx),导出面单);

            }, 1000)

          }
        })
        .catch(err => {});
    },

 

html转pdf/vue中导出pdf

标签:nload   联系   beef   -o   into   center   let   ble   mat   

原文地址:https://www.cnblogs.com/shuihanxiao/p/12838334.html


评论


亲,登录后才可以留言!