当前位置: 首页 > news >正文

申请免费建站百度推广app下载

申请免费建站,百度推广app下载,手机浏览网页在线代理,免签接口wordpress1、安装 npm install vueshowpdf -S2、参数 属性说明类型默认值v-model是否显示pdf--pdfurlpdf的文件地址String- scale 默认放大倍数 Number1.2 minscale 最小放大倍数 Number0.8 maxscale 最大放大倍数 Number2 3、事件 名称说明回调参数closepdf pdf关闭事件-pdferr文…

1、安装

npm install vueshowpdf -S

2、参数

属性说明类型默认值
v-model是否显示pdf--
pdfurlpdf的文件地址String-

scale

默认放大倍数

Number1.2

minscale

最小放大倍数

Number0.8

maxscale

最大放大倍数

Number2

3、事件

名称说明回调参数
closepdf pdf关闭事件-
pdferr文件地址解析错误事件-

4、核心代码

<template><div class="case-info"><van-cell title="附件" value="预览" is-link @click="viewPdf" class="perview" /><vueshowpdf class="pdf" v-model="isShowPdf" :pdfurl="pdfurl":minscale='0.4' :scale='0.6' @closepdf="isShowPdf = false" @pdferr="pdfError"></vueshowpdf></div>
</template><script>
import api from '@/api.js'
import vueshowpdf from 'vueshowpdf'
export default {name: 'test',data () {return {isShowPdf: false,pdfUrl: '',pdfKey: 0}},components: {vueshowpdf},deactivated () {// 离开页面默认关闭pdfthis.isShowPdf = falsethis.pdfKey++},methods: {// 预览pdfasync viewPdf () {if (this.pdfUrl) {this.isShowPdf = true} else {this.$toast.loading({message: '加载中...',duration: 0,forbidClick: true})try {const res = await api.getFilePreview()this.$toast.clear()if (res.code === '0') {let blob = this.dataURLtoBlob(res.data)this.pdfurl = URL.createObjectURL(blob)this.isShowPdf = true} else {this.$toast(res.msg || '该原始文件不存在')}} catch (error) {this.$toast.clear()}}},// 将base64转换为文件dataURLtoBlob (dataurl) {const bstr = atob(dataurl)let n = bstr.lengthconst u8arr = new Uint8Array(n)while (n--) {u8arr[n] = bstr.charCodeAt(n)}return new Blob([u8arr], { type: 'application/pdf' })},// 关闭pdfclosePdf () {this.isShowPdf = falsethis.pdfKey++},// pdf预览失败pdfError (errorUrl) {this.$toast.fail('预览失败')this.isShowPdf = falsethis.pdfKey++}}
}
</script><style lang="scss" scoped>.perview .van-cell__value {color: #468bff;text-decoration: underline;}
</style>

http://www.ritt.cn/news/23055.html

相关文章:

  • 北京有名的设计公司有哪些windows优化大师win10
  • 做网站建设的公司产品网络营销方案
  • 建设网站费用计入什么科目百度学术查重
  • 东莞网站建设推广费用seo五大经验分享
  • 为什么有的网站打不开 别的网站就可以打开网站seo推广公司靠谱吗
  • 番禺品牌型网站建设口碑营销理论
  • 中学网站asp模板泉州网站seo公司
  • 网站模板设计师要求网页搜索引擎
  • 做一个网站需要哪些上海百度推广公司排名
  • 最权威的做网站的公司哪家好免费广告投放网站
  • 无经验能做sem专员四川网站seo
  • 自己开网站能赚钱吗山东网站seo
  • 专业做网站app的公司哪家好国外新闻最新消息
  • 百度?o法提交网站网络推广团队
  • 网站建设方式国际新闻最新消息十条摘抄
  • 宿州网站开发建设百度一下搜索
  • 网页编辑哪个键杭州seo泽成
  • 怎么做网站frontpage2022年新闻大事
  • 手机网站域名哪里注册快手流量推广网站
  • aspnet网站开发作业青岛网站制作公司
  • html5网站开发视频seo怎么收费
  • 级a做爰片免费视网站看看百度产品大全首页
  • wordpress资源销售seo百度首页排名业务
  • 昆明企业网站建设公司长沙官网优化公司
  • WordPress实现点击复制南京谷歌优化
  • 网站设计首页一网信息一个简单便捷的新闻网站
  • html设计网站广东宣布即时优化调整
  • 绵阳集团网站建设seo排名优化资源
  • 怎么看网站发的外链seo课程培训机构
  • 网站建设的流程是什么意思网络销售是干嘛的