qmwts 1.1.33 → 1.1.35

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.
@@ -41,15 +41,16 @@ var file_utils_1 = require("./file-utils");
41
41
  exports.default = {
42
42
  zip: function (urls) {
43
43
  return __awaiter(this, void 0, void 0, function () {
44
- var fetch, zip, index, _i, urls_1, url, response, blob;
44
+ var fetch, URL, zip, index, _i, urls_1, url, response, blob;
45
45
  return __generator(this, function (_a) {
46
46
  switch (_a.label) {
47
47
  case 0:
48
- fetch = window.fetch;
48
+ fetch = window.fetch, URL = window.URL;
49
49
  if (!fetch) {
50
50
  alert('您的浏览器不支持fetch');
51
51
  return [2 /*return*/];
52
52
  }
53
+ urls = [urls].flat(Infinity);
53
54
  zip = new JSZip();
54
55
  index = 1;
55
56
  _i = 0, urls_1 = urls;
@@ -70,12 +71,11 @@ exports.default = {
70
71
  return [3 /*break*/, 1];
71
72
  case 5:
72
73
  zip.generateAsync({ type: 'blob' }).then(function (blob) {
73
- var URL = window.URL;
74
- var url = URL.createObjectURL(blob);
75
74
  var a = document.createElement('a');
76
- a.href = url;
75
+ a.href = URL.createObjectURL(blob);
77
76
  a.click();
78
- URL.revokeObjectURL(url);
77
+ URL.revokeObjectURL(a.href);
78
+ a.remove();
79
79
  });
80
80
  return [2 /*return*/];
81
81
  }
@@ -20,10 +20,13 @@ exports.default = {
20
20
  if (fixed === void 0) { fixed = 2; }
21
21
  if (!this.isNumber(number))
22
22
  return '';
23
- return new Intl.NumberFormat('en-US', {
23
+ number = new Intl.NumberFormat('en-US', {
24
24
  minimumFractionDigits: fixed,
25
25
  maximumFractionDigits: fixed,
26
26
  }).format(number);
27
+ if (+number === 0) // -0转为普通0
28
+ return (0).toFixed(fixed);
29
+ return number;
27
30
  },
28
31
  summation: function (array) {
29
32
  var _this = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qmwts",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/dist/a.d.ts DELETED
File without changes
package/dist/a.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // 获取挂载元素的样式
3
- // window.getComputedStyle(this.$refs.xxx)