emacroh5lib 1.0.29 → 1.0.30

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.29",
3
+ "version": "1.0.30",
4
4
  "description": "EMacro前端组件库",
5
5
  "main": "dist/emacroh5lib.min.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "serve": "webpack serve",
15
15
  "dev": "vue-cli-service test:e2e",
16
16
  "commit": "cz",
17
- "push": "webpack --mode=production --node-env=production && npm publish --registry https://registry.npmjs.org",
17
+ "push": "npm run build && npm publish --registry https://registry.npmjs.org",
18
18
  "test": "echo \"Error: no test specified\" && exit 1"
19
19
  },
20
20
  "keywords": [
@@ -4,7 +4,7 @@
4
4
  <img ref="duoViewerImage" :src="realSrc" alt="image" class="duo-viewer-mask__image" />
5
5
  </div>
6
6
  <div class="duo-viewer-footer">
7
- <div class="duo-viewer-footer__title">{{ realSrc }}</div>
7
+ <div class="duo-viewer-footer__title">{{ realName }}</div>
8
8
  <div class="duo-viewer-footer__toolbar">
9
9
  <ul>
10
10
  <li class="duo-viewer-footer__zoom-in" data-viewer-action="zoom-in"></li>
@@ -71,6 +71,18 @@
71
71
  type: Number,
72
72
  default: 0,
73
73
  },
74
+ name: {
75
+ type: [String, Array],
76
+ default: null,
77
+ },
78
+ shrink: {
79
+ type: Number,
80
+ default: .4,
81
+ },
82
+ enlarge: {
83
+ type: Number,
84
+ default: .6,
85
+ }
74
86
  },
75
87
  computed: {
76
88
  listLength() {
@@ -79,6 +91,17 @@
79
91
  realSrc() {
80
92
  return this.list[this.index];
81
93
  },
94
+ realName() {
95
+ if (this.name == null) {
96
+ return this.list[this.index];
97
+ } else if (typeof this.name == "string") {
98
+ return this.name
99
+ } else if (Array.isArray(this.name)) {
100
+ return this.name[this.index];
101
+ } else {
102
+ return "未命名"
103
+ }
104
+ },
82
105
  currentData() {
83
106
  return this.listDataCache[this.index];
84
107
  },
@@ -312,11 +335,11 @@
312
335
  if (h <= 20 && type === "out") return;
313
336
 
314
337
  if (type === "out") {
315
- this.setStyleByName(image, "width", `${w * 0.45}px`);
316
- this.setStyleByName(image, "height", `${h * 0.45}px`);
338
+ this.setStyleByName(image, "width", `${w * this.shrink}px`);
339
+ this.setStyleByName(image, "height", `${h * this.shrink}px`);
317
340
  } else {
318
- this.setStyleByName(image, "width", `${w * (1 + 0.35)}px`);
319
- this.setStyleByName(image, "height", `${h * (1 + 0.35)}px`);
341
+ this.setStyleByName(image, "width", `${w * (1 + this.enlarge)}px`);
342
+ this.setStyleByName(image, "height", `${h * (1 + this.enlarge)}px`);
320
343
  }
321
344
 
322
345
  this.currentData.width = this.getStyleByName(this.image, "width");
@@ -362,6 +385,10 @@
362
385
  // up
363
386
  this.zoom("in");
364
387
  }
388
+ if (e && e.keyCode == 27) {
389
+ // esc
390
+ this.handleClose()
391
+ }
365
392
  });
366
393
  },
367
394