验证码: 看不清楚,换一张 查询 注册会员,免验证
  • {{ basic.site_slogan }}
  • 打开微信扫一扫,
    您还可以在这里找到我们哟

    关注我们

Vue怎么使用vue-pdf实现PDF文件预览

阅读:672 来源:乙速云 作者:代码code

Vue怎么使用vue-pdf实现PDF文件预览

先看下效果 

Vue怎么使用vue-pdf实现PDF文件预览

安装

npm install vue-pdf

页面按需引入并注册

import Pdf from "vue-pdf"
export default {
  components: { Pdf }
}

完整代码




.global {
  width: 100%;
  height: 100%;
}
.preview {
  width: 100%;
  height: 50px;
}
 
.pdfContainer {
  width: 100%;
  height: calc(100% - 50px);
}
.pdfContainer .button {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
}
.pdfContainer .pdf {
  width: 100%;
  height: calc(100% - 100px);
  overflow-y: auto;
}
.pdfContainer .page {
  width: 100%;
  height: 50px;
}
 
.pageNum {
  font-size: 28px;
}
分享到:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: hlamps#outlook.com (#换成@)。
相关文章
{{ v.title }}
{{ v.description||(cleanHtml(v.content)).substr(0,100)+'···' }}
你可能感兴趣
推荐阅读 更多>