提交 e595f494 编写于 作者: huangwensu's avatar huangwensu

打开PDF

上级 03c42160
...@@ -22,8 +22,11 @@ export default { ...@@ -22,8 +22,11 @@ export default {
mounted() { mounted() {
this.imgWidth = this.imgData.width; this.imgWidth = this.imgData.width;
this.imgHeight = this.imgData.height; this.imgHeight = this.imgData.height;
this.imgProportion = this.imgWidth / this.imgHeight; this.imgProportion = (this.imgWidth / this.imgHeight).toFixed(1);
console.log("==========dddddddddd",this.imgProportion) console.log("==========dddddddddd",this.imgProportion)
if(this.imgProportion > 0.6) {
}
}, },
methods: { methods: {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<!-- <img-size :imgData="item"></img-size> --> <!-- <img-size :imgData="item"></img-size> -->
</div> </div>
<div v-if="item.type == 2" class="file-content"> <div v-if="item.type == 2" class="file-content">
<div class="file-con" @click="downPDF()"> <div class="file-con" @click="openPDF(item.url)">
<div class="file-left"> <div class="file-left">
<span class="name">{{item.info | shortName(23)}}</span> <span class="name">{{item.info | shortName(23)}}</span>
<span class="size">{{item.fileSize}}</span> <span class="size">{{item.fileSize}}</span>
...@@ -84,6 +84,10 @@ export default { ...@@ -84,6 +84,10 @@ export default {
let a = document.createElement('a'); let a = document.createElement('a');
a.setAttribute('href', this.detailData.fileUrl); a.setAttribute('href', this.detailData.fileUrl);
a.click(); a.click();
},
// 打开PDF
openPDF(url) {
window.open(url, "__blank");
} }
} }
}; };
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册