VUE預覽PDF

    模板使用vue

<pdf ref="pdf" :src="pdfUrl" style="width: 100%;"></pdf>

  安裝pdfgit

npm install --save vue-pdf

  在須要使用的頁面引用github

import pdf from 'vue-pdf'
export default {
  components:{
      pdf:pdf
  },
}

  獲取到pdf的url後直接賦值便可npm

this.pdfUrl = pdf.createLoadingTask(pdfurl)

  相關學習連接 https://blog.csdn.net/weixin_43452622/article/details/88234792
       pdf預覽dom:https://github.com/goSunadeod/vue-pdf.js-demodom

相關文章
相關標籤/搜索