@toolspack/ttd-pdfjs 0.1.2 → 0.1.3

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": "@toolspack/ttd-pdfjs",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "main": "lib/ttd-pdfjs.umd.min.js",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -15,7 +15,7 @@
15
15
  >
16
16
  <el-button>上传</el-button>
17
17
  </el-upload>
18
- <PdfView :rotateEnable= true :zoomEnable= true :pdfurl="url" />
18
+ <PdfView :rotateEnable= true :scale="1.5" :zoomEnable= true :pdfurl="url" />
19
19
  </div>
20
20
  </template>
21
21
 
@@ -157,15 +157,13 @@ export default {
157
157
  this.compuscale = scaleNum
158
158
  this.maxscale = scaleNum
159
159
  }
160
- console.log('xxxxxx', this.compuRotate, viewport.rotation)
160
+ // console.log('xxxxxx', this.compuRotate, viewport.rotation)
161
161
  this.compuRotate = viewport.rotation
162
162
  this.initPage = false
163
163
  }
164
164
  // 重新渲染 缩放过的PDF
165
- console.log('1111111', this.compuRotate)
166
165
  viewport = page.getViewport({ scale: scaleNum, rotation: this.compuRotate })
167
166
  this.viewport = viewport
168
- console.log('22222222', viewport)
169
167
 
170
168
  // 将 canvas 尺寸 传给父组件
171
169
  this.$emit('size', viewport, num)
@@ -314,7 +312,6 @@ export default {
314
312
  this.renderPage(this.pageNum)
315
313
  },
316
314
  onRotate(rotate) {
317
- console.log('000000', this.compuRotate, rotate)
318
315
  this.compuRotate += rotate
319
316
  this.renderPage(this.pageNum)
320
317
  },
@@ -1,5 +1,5 @@
1
1
  <template lang="html">
2
- <div class="switch-page">
2
+ <div class="ttd-pdfjs-switch-page" ref=switchPageBox>
3
3
  <div class='switch-page-btn'>
4
4
  <el-button size="mini" @click="switchPage('prev')" icon=el-icon-arrow-up>上一页</el-button>
5
5
  <el-button size="mini" @click="switchPage('next')" icon=el-icon-arrow-down>下一页</el-button>
@@ -98,6 +98,9 @@ export default {
98
98
  },
99
99
  },
100
100
  methods: {
101
+ mounted() {
102
+
103
+ },
101
104
  switchPage(str) {
102
105
  if (str === 'prev') {
103
106
  if (this.itemPage === 1) {
@@ -167,8 +170,8 @@ export default {
167
170
  }
168
171
  </script>
169
172
 
170
- <style lang="less" scoped>
171
- .switch-page {
173
+ <style lang="less">
174
+ .ttd-pdfjs-switch-page {
172
175
  margin: 0;
173
176
  padding: 0;
174
177
  display: flex;
@@ -176,12 +179,17 @@ export default {
176
179
  .switch-page-scale{
177
180
  flex: 1;
178
181
  text-align: center;
182
+ white-space: nowrap;
183
+ overflow: hidden;
184
+ .el-select{
185
+ width: 140px;
186
+ }
179
187
  }
180
188
  button {
181
189
  font-size: 14px;
182
190
  padding: 6px !important;
183
191
  }
184
- @media (min-width: 731px) {
192
+ @media (max-width: 731px) {
185
193
  .hidden-text {
186
194
  display: none;
187
195
  }