zydx-plus 1.28.129 → 1.28.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.28.129",
3
+ "version": "1.28.130",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -11,13 +11,13 @@
11
11
  <canvas :id="id"></canvas>
12
12
  </div>
13
13
  </div>
14
- <div class="page-but-left" :style="{cursor: pageIndex === 1?'default':'pointer'}" @click="flipLeft(pageIndex-=1,false)"></div>
15
- <div class="page-but-right" :style="{cursor: pageIndex === pdfPages?'default':'pointer'}" @click="flipRight(pageIndex+=1,false)"></div>
14
+ <div class="page-but-left" :style="{cursor: pageIndex === 1?'default':'pointer'}" @click="flipRight(pageIndex-=1,false)"></div>
15
+ <div class="page-but-right" :style="{cursor: pageIndex === pdfPages?'default':'pointer'}" @click="flipLeft(pageIndex+=1,false)"></div>
16
16
  </div>
17
17
  </div>
18
18
  <div class="but-wrap" v-if="butShow">
19
- <button class="but-brown" :disabled="pageIndex === 1" :class="{'but-act': pageIndex === 1}" @click="flipLeft(pageIndex-=1,false)">上一页</button>
20
- <button class="but-brown" :disabled="pageIndex === pdfPages" :class="{'but-act': pageIndex === pdfPages}" @click="flipRight(pageIndex+=1,false)">下一页</button>
19
+ <button class="but-brown" :disabled="pageIndex === 1" :class="{'but-act': pageIndex === 1}" @click="flipRight(pageIndex-=1,false)">上一页</button>
20
+ <button class="but-brown" :disabled="pageIndex === pdfPages" :class="{'but-act': pageIndex === pdfPages}" @click="flipLeft(pageIndex+=1,false)">下一页</button>
21
21
  </div>
22
22
  </div>
23
23
  <div v-if="loading" class="loading-back">
@@ -93,13 +93,13 @@ export default {
93
93
  },
94
94
  methods: {
95
95
  flipLeft(e,v) {
96
- if(e < 1) {
97
- this.pageIndex = 1
96
+ if(e >= this.pdfPages) {
97
+ this.pageIndex = this.pdfPages
98
98
  return
99
99
  }else {
100
100
  this.pageIndex = e
101
101
  }
102
- this.oneIndex = 'left'
102
+ this.oneIndex = 'right'
103
103
  this.readPdf()
104
104
  if(!v) {
105
105
  this.$emit('flip', {
@@ -109,13 +109,13 @@ export default {
109
109
  }
110
110
  },
111
111
  flipRight(e,v) {
112
- if(e >= this.pdfPages) {
113
- this.pageIndex = this.pdfPages
112
+ if(e < 1) {
113
+ this.pageIndex = 1
114
114
  return
115
115
  }else {
116
116
  this.pageIndex = e
117
117
  }
118
- this.oneIndex = 'right'
118
+ this.oneIndex = 'left'
119
119
  this.readPdf()
120
120
  if(!v) {
121
121
  this.$emit('flip', {
@@ -128,7 +128,9 @@ export default {
128
128
  if(this.source === '' || this.source === undefined || this.source === null) return
129
129
  let that = this
130
130
  that.loading = true
131
- that.oneShow = that.pageIndex !== 1
131
+ if(that.imgArr[that.pageIndex - 1] !== undefined) {
132
+ that.oneShow = that.pageIndex !== 1
133
+ }
132
134
  const loadingTask = PdfJs.getDocument(this.source)
133
135
  loadingTask.promise.then((pdf) => {
134
136
  that.pdfPages = pdf.numPages // 获取pdf文件的总页数
package/src/index.js CHANGED
@@ -67,7 +67,7 @@ function install(app) {
67
67
  }
68
68
 
69
69
  export default {
70
- version: '1.28.129',
70
+ version: '1.28.130',
71
71
  install,
72
72
  Calendar,
73
73
  Message,