PDF地址修改

This commit is contained in:
mengxiaolong
2021-01-14 15:28:31 +08:00
parent a8a572737e
commit 004c6f54be

View File

@@ -1,7 +1,7 @@
<template>
<div class="detail">
<img v-if="type === 'img'" :src="$assetsUrl + img" @click="prevImg" />
<iframe v-if="type === 'pdf'" :src="$assetsUrl + img" frameborder="0" class="pdf"></iframe>
<iframe v-if="type === 'pdf'" :src="pdfUrl()" frameborder="0" class="pdf"></iframe>
</div>
</template>
@@ -30,6 +30,9 @@ export default {
document.title = this.title
},
methods: {
pdfUrl() {
return location.origin + '/pdfjs/web/viewer.html?file=' + this.$assetsUrl + this.img
},
prevImg() {
ImagePreview([this.$assetsUrl + this.img])
}