emacroh5lib 1.0.55 → 1.0.56

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": "emacroh5lib",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -54,7 +54,9 @@
54
54
  viewerSrc: "",
55
55
  image: null,
56
56
  listDataCache: [],
57
- index: 0
57
+ index: 0,
58
+ _shrink: 0.4,
59
+ _enlarge: 0.6,
58
60
  };
59
61
  },
60
62
  props: {
@@ -124,6 +126,8 @@
124
126
  },
125
127
  },
126
128
  mounted() {
129
+ this._shrink = 1 - this.shrink
130
+ this._enlarge = 1 + this.enlarge
127
131
  },
128
132
  methods: {
129
133
  // Global init
@@ -415,30 +419,28 @@
415
419
  zoom(type) {
416
420
  let image = this.image;
417
421
 
418
- console.log("报错1", image);
419
422
  let w = +this.getStyleByName(image, "width").split("px")[0];
420
423
  let h = +this.getStyleByName(image, "height").split("px")[0];
421
424
 
422
425
  if (h <= 20 && type === "out") return;
423
426
 
424
427
  if (type === "out") {
425
- console.log("报错2", `${w * (1 - this.shrink)}px`);
426
- this.setStyleByName(image, "width", `${w * (1 - this.shrink)}px`);
427
- this.setStyleByName(image, "height", `${h * (1 - this.shrink)}px`);
428
- console.log("报错3");
428
+ this.setStyleByName(image, "width", `${w * this._shrink}px`);
429
+ this.setStyleByName(image, "height", `${h * this._shrink}px`);
429
430
  } else {
430
- console.log("报错4", `${w * (1 + this.enlarge)}px`);
431
- this.setStyleByName(image, "width", `${w * (1 + this.enlarge)}px`);
432
- this.setStyleByName(image, "height", `${h * (1 + this.enlarge)}px`);
433
- console.log("报错5");
431
+ this.setStyleByName(image, "width", `${w * this._enlarge}px`);
432
+ this.setStyleByName(image, "height", `${h * this._enlarge}px`);
434
433
  }
435
434
 
436
- console.log("报错6", this.currentData);
437
- console.log("报错7", image);
438
- console.log("报错8", this.image);
435
+ // console.log("报错6", this.currentData);
436
+ // console.log("报错7", image);
437
+ // console.log("报错8", this.image);
438
+
439
+ if (this.currentData) {
440
+ this.currentData.width = this.getStyleByName(this.image, "width");
441
+ this.currentData.height = this.getStyleByName(this.image, "height");
442
+ }
439
443
 
440
- this.currentData.width = this.getStyleByName(this.image, "width");
441
- this.currentData.height = this.getStyleByName(this.image, "height");
442
444
  },
443
445
 
444
446
  // FullScreen action