主页 > 电脑硬件  > 

uniapp实现app的pdf预览

uniapp实现app的pdf预览
实现效果 文件准备

static下添加该pdf文件(下载地址: gitee /shallow-winds/resource_package/tree/master/%E6%96%B9%E6%B3%95%E4%B8%80/html)

使用web-view进行展示: 在这里插入代码片`

<web-view :src="url"></web-view>` data() { return { url: '', viewerUrl: '/static/html/web/viewer.html?file=', } },

将viewerUrl与pdf地址进行拼接:

getquery(id){ uni.showLoading({ title: '加载中' }); this.$http.request({ url: ``, method: 'post', }).then(res => { this.url = this.viewerUrl + res.data.articlesUrl uni.hideLoading(); }).catch(res => { }) }
标签:

uniapp实现app的pdf预览由讯客互联电脑硬件栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“uniapp实现app的pdf预览