Commit 1e4ad6b2 authored by miaojiale's avatar miaojiale

修改pdf

parent 9c1e1697
......@@ -3,6 +3,7 @@
<el-dialog
custom-class="pdfDialog"
:title="''"
:width="dWidth + 'px'"
:visible.sync="showPdf"
:close-on-click-modal="true"
:close-on-press-escape="false"
......@@ -14,7 +15,7 @@
<div class="title">{{ curPdf.articleTitle }}</div>
<div class="refuteList">
<!-- <pdf :src="pdfSrc"></pdf> -->
<pdf-view ref="pdfView" :pdfUrl="pdfSrc"></pdf-view>
<pdf-view ref="pdfView" :pdfUrl="pdfSrc" @scale="setScale"></pdf-view>
</div>
</div>
</el-dialog>
......@@ -33,8 +34,16 @@ export default {
data() {
return {
showPdf: false,
width: 750,
dWidth: 750,
}
},
methods: {
setScale(val) {
console.log(val)
this.dWidth = this.width * (val / 100)
},
},
watch: {
showPdf(v) {
if (v) {
......@@ -66,8 +75,7 @@ export default {
</style>
<style lang="scss">
.pdfDialog {
width: 750px;
max-height: 858px;
max-height: 958px;
.el-dialog__header {
// display: none;
padding: 0px !important;
......
......@@ -104,8 +104,12 @@ export default {
//放大
scaleD() {
if (this.scale == 120) {
return
}
this.scale += 5
this.$refs.pdf.$el.style.width = parseInt(this.scale) + "%"
this.$emit("scale", this.scale)
},
//缩小
......@@ -115,8 +119,9 @@ export default {
return
}
this.scale += -5
console.log(parseInt(this.scale) + "%")
// console.log(parseInt(this.scale) + "%")
this.$refs.pdf.$el.style.width = parseInt(this.scale) + "%"
this.$emit("scale", this.scale)
},
// 切换上一页
prePage() {
......@@ -190,7 +195,7 @@ export default {
.show {
overflow: auto;
margin: auto;
max-width: 790px;
// max-width: 790px;
max-height: 660px;
}
.pdf_footer {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment