zydx-plus 1.35.486 → 1.35.487

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.35.486",
3
+ "version": "1.35.487",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -170,6 +170,7 @@ export default {
170
170
  showMultiText:false,
171
171
  showSingleText:false,
172
172
  boxWidth:'',
173
+ resizeObserver: null
173
174
  }
174
175
  },
175
176
  props: {
@@ -300,26 +301,34 @@ export default {
300
301
  if (this.isDrawing || this.checkDrawing) this.mouseUp()
301
302
  this.textMoveStart = false
302
303
  }
303
- setTimeout(()=>{
304
- const el = this.$refs.book;
305
- let resizeTimer ;
306
- const resizeObserver = new ResizeObserver(() => {
307
- clearTimeout(resizeTimer);
308
- resizeTimer = setTimeout(() => {
309
- if(this.doublePage){
310
- this.readDoublePdf()
311
- }else {
312
- this.readPdf()
313
- }
314
- }, 150); // 根据需求调整延迟时间
315
- });
316
- resizeObserver.observe(el);
317
- },300)
304
+ this.setResizeObserver()
318
305
  },
319
306
  beforeDestroy() {
320
307
  window.removeEventListener('keydown', this.handleKeyEvent)
308
+ this.cancelResizeObserver()
321
309
  },
322
310
  methods: {
311
+ setResizeObserver() {
312
+ setTimeout(()=>{
313
+ const el = this.$refs.book;
314
+ let resizeTimer ;
315
+ this.resizeObserver = new ResizeObserver(() => {
316
+ clearTimeout(resizeTimer);
317
+ resizeTimer = setTimeout(() => {
318
+ if(this.doublePage){
319
+ this.readDoublePdf()
320
+ }else {
321
+ this.readPdf()
322
+ }
323
+ }, 150); // 根据需求调整延迟时间
324
+ });
325
+ this.resizeObserver.observe(el);
326
+ },300)
327
+ },
328
+ cancelResizeObserver() {
329
+ const el = this.$refs.book;
330
+ this.resizeObserver.unobserve(el);
331
+ },
323
332
  showPen() {
324
333
  this.$emit('showPen', true)
325
334
  // this.isDraw = true
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.486',
90
+ version: '1.35.487',
91
91
  install,
92
92
  Calendar,
93
93
  Message,