xrk-components 0.5.5 → 0.5.6
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/lib/index.esm.js +43 -35
- package/lib/index.umd.js +43 -35
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -46486,7 +46486,9 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46486
46486
|
var _props = __props;
|
|
46487
46487
|
var props = _props;
|
|
46488
46488
|
var baseUploadRef = ref(null);
|
|
46489
|
-
var
|
|
46489
|
+
var uploadCount = ref(0);
|
|
46490
|
+
var uploadEndCount = ref(0);
|
|
46491
|
+
var uploading = computed$1(function () { return uploadCount.value > uploadEndCount.value; });
|
|
46490
46492
|
var fileList = ref([]);
|
|
46491
46493
|
var accept = computed$1(function () {
|
|
46492
46494
|
var _a;
|
|
@@ -46577,18 +46579,18 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46577
46579
|
return __generator(this, function (_a) {
|
|
46578
46580
|
switch (_a.label) {
|
|
46579
46581
|
case 0:
|
|
46580
|
-
|
|
46582
|
+
uploadCount.value += 1;
|
|
46581
46583
|
_a.label = 1;
|
|
46582
46584
|
case 1:
|
|
46583
46585
|
_a.trys.push([1, 3, , 4]);
|
|
46584
46586
|
return [4 /*yield*/, props.httpRequest({ file: options.file })];
|
|
46585
46587
|
case 2:
|
|
46586
46588
|
res = _a.sent();
|
|
46587
|
-
|
|
46589
|
+
uploadEndCount.value += 1;
|
|
46588
46590
|
return [2 /*return*/, res];
|
|
46589
46591
|
case 3:
|
|
46590
46592
|
_a.sent();
|
|
46591
|
-
|
|
46593
|
+
uploadEndCount.value += 1;
|
|
46592
46594
|
console.warn('上传失败', options.file);
|
|
46593
46595
|
throw 'upload fail';
|
|
46594
46596
|
case 4: return [2 /*return*/];
|
|
@@ -46698,7 +46700,7 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46698
46700
|
"file-list": fileList.value,
|
|
46699
46701
|
"show-file-list": false,
|
|
46700
46702
|
multiple: __props.multiple,
|
|
46701
|
-
disabled: uploading
|
|
46703
|
+
disabled: unref(uploading) || __props.disabled,
|
|
46702
46704
|
drag: __props.drag,
|
|
46703
46705
|
accept: unref(accept),
|
|
46704
46706
|
"http-request": _httpRequest,
|
|
@@ -46711,7 +46713,7 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46711
46713
|
((_a = unref(slots)) === null || _a === void 0 ? void 0 : _a.default)
|
|
46712
46714
|
? renderSlot(_ctx.$slots, "default", {
|
|
46713
46715
|
key: 0,
|
|
46714
|
-
slotScope: { uploading: uploading
|
|
46716
|
+
slotScope: { uploading: unref(uploading) }
|
|
46715
46717
|
})
|
|
46716
46718
|
: (__props.drag)
|
|
46717
46719
|
? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
@@ -46728,7 +46730,7 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46728
46730
|
], 64 /* STABLE_FRAGMENT */))
|
|
46729
46731
|
: (openBlock(), createBlock(unref(BaseButton), {
|
|
46730
46732
|
key: 2,
|
|
46731
|
-
loading: uploading
|
|
46733
|
+
loading: unref(uploading)
|
|
46732
46734
|
}, {
|
|
46733
46735
|
default: withCtx(function () { return [
|
|
46734
46736
|
_hoisted_4
|
|
@@ -46775,20 +46777,23 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46775
46777
|
_: 2 /* DYNAMIC */
|
|
46776
46778
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content"])
|
|
46777
46779
|
]),
|
|
46778
|
-
|
|
46779
|
-
|
|
46780
|
-
|
|
46781
|
-
|
|
46782
|
-
|
|
46783
|
-
|
|
46784
|
-
|
|
46785
|
-
|
|
46786
|
-
|
|
46787
|
-
|
|
46788
|
-
|
|
46789
|
-
|
|
46790
|
-
|
|
46791
|
-
|
|
46780
|
+
(!__props.disabled)
|
|
46781
|
+
? (openBlock(), createElementBlock("div", {
|
|
46782
|
+
key: 0,
|
|
46783
|
+
class: "xrk-upload__item_icon__del",
|
|
46784
|
+
onClick: function () { return handleFileDel(index); }
|
|
46785
|
+
}, [
|
|
46786
|
+
createVNode(unref(BaseIcon), {
|
|
46787
|
+
color: "#606266",
|
|
46788
|
+
size: 16
|
|
46789
|
+
}, {
|
|
46790
|
+
default: withCtx(function () { return [
|
|
46791
|
+
_hoisted_10
|
|
46792
|
+
]; }),
|
|
46793
|
+
_: 1 /* STABLE */
|
|
46794
|
+
})
|
|
46795
|
+
], 8 /* PROPS */, _hoisted_9))
|
|
46796
|
+
: createCommentVNode("v-if", true)
|
|
46792
46797
|
]));
|
|
46793
46798
|
}), 128 /* KEYED_FRAGMENT */))
|
|
46794
46799
|
: createCommentVNode("v-if", true),
|
|
@@ -46816,20 +46821,23 @@ var script$4 = /*#__PURE__*/ defineComponent(__assign(__assign({}, __default__$4
|
|
|
46816
46821
|
_: 1 /* STABLE */
|
|
46817
46822
|
})
|
|
46818
46823
|
], 8 /* PROPS */, _hoisted_13),
|
|
46819
|
-
|
|
46820
|
-
|
|
46821
|
-
|
|
46822
|
-
|
|
46823
|
-
|
|
46824
|
-
|
|
46825
|
-
|
|
46826
|
-
|
|
46827
|
-
|
|
46828
|
-
|
|
46829
|
-
|
|
46830
|
-
|
|
46831
|
-
|
|
46832
|
-
|
|
46824
|
+
(!__props.disabled)
|
|
46825
|
+
? (openBlock(), createElementBlock("div", {
|
|
46826
|
+
key: 0,
|
|
46827
|
+
style: { "margin-left": "1em" },
|
|
46828
|
+
onClick: function () { return handleFileDel(index); }
|
|
46829
|
+
}, [
|
|
46830
|
+
createVNode(unref(BaseIcon), {
|
|
46831
|
+
color: "#fff",
|
|
46832
|
+
size: 18
|
|
46833
|
+
}, {
|
|
46834
|
+
default: withCtx(function () { return [
|
|
46835
|
+
_hoisted_16
|
|
46836
|
+
]; }),
|
|
46837
|
+
_: 1 /* STABLE */
|
|
46838
|
+
})
|
|
46839
|
+
], 8 /* PROPS */, _hoisted_15))
|
|
46840
|
+
: createCommentVNode("v-if", true)
|
|
46833
46841
|
])
|
|
46834
46842
|
]));
|
|
46835
46843
|
}), 128 /* KEYED_FRAGMENT */))
|
package/lib/index.umd.js
CHANGED
|
@@ -46489,7 +46489,9 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46489
46489
|
var _props = __props;
|
|
46490
46490
|
var props = _props;
|
|
46491
46491
|
var baseUploadRef = vue.ref(null);
|
|
46492
|
-
var
|
|
46492
|
+
var uploadCount = vue.ref(0);
|
|
46493
|
+
var uploadEndCount = vue.ref(0);
|
|
46494
|
+
var uploading = vue.computed(function () { return uploadCount.value > uploadEndCount.value; });
|
|
46493
46495
|
var fileList = vue.ref([]);
|
|
46494
46496
|
var accept = vue.computed(function () {
|
|
46495
46497
|
var _a;
|
|
@@ -46580,18 +46582,18 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46580
46582
|
return __generator(this, function (_a) {
|
|
46581
46583
|
switch (_a.label) {
|
|
46582
46584
|
case 0:
|
|
46583
|
-
|
|
46585
|
+
uploadCount.value += 1;
|
|
46584
46586
|
_a.label = 1;
|
|
46585
46587
|
case 1:
|
|
46586
46588
|
_a.trys.push([1, 3, , 4]);
|
|
46587
46589
|
return [4 /*yield*/, props.httpRequest({ file: options.file })];
|
|
46588
46590
|
case 2:
|
|
46589
46591
|
res = _a.sent();
|
|
46590
|
-
|
|
46592
|
+
uploadEndCount.value += 1;
|
|
46591
46593
|
return [2 /*return*/, res];
|
|
46592
46594
|
case 3:
|
|
46593
46595
|
_a.sent();
|
|
46594
|
-
|
|
46596
|
+
uploadEndCount.value += 1;
|
|
46595
46597
|
console.warn('上传失败', options.file);
|
|
46596
46598
|
throw 'upload fail';
|
|
46597
46599
|
case 4: return [2 /*return*/];
|
|
@@ -46701,7 +46703,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46701
46703
|
"file-list": fileList.value,
|
|
46702
46704
|
"show-file-list": false,
|
|
46703
46705
|
multiple: __props.multiple,
|
|
46704
|
-
disabled: uploading
|
|
46706
|
+
disabled: vue.unref(uploading) || __props.disabled,
|
|
46705
46707
|
drag: __props.drag,
|
|
46706
46708
|
accept: vue.unref(accept),
|
|
46707
46709
|
"http-request": _httpRequest,
|
|
@@ -46714,7 +46716,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46714
46716
|
((_a = vue.unref(slots)) === null || _a === void 0 ? void 0 : _a.default)
|
|
46715
46717
|
? vue.renderSlot(_ctx.$slots, "default", {
|
|
46716
46718
|
key: 0,
|
|
46717
|
-
slotScope: { uploading: uploading
|
|
46719
|
+
slotScope: { uploading: vue.unref(uploading) }
|
|
46718
46720
|
})
|
|
46719
46721
|
: (__props.drag)
|
|
46720
46722
|
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
@@ -46731,7 +46733,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46731
46733
|
], 64 /* STABLE_FRAGMENT */))
|
|
46732
46734
|
: (vue.openBlock(), vue.createBlock(vue.unref(BaseButton), {
|
|
46733
46735
|
key: 2,
|
|
46734
|
-
loading: uploading
|
|
46736
|
+
loading: vue.unref(uploading)
|
|
46735
46737
|
}, {
|
|
46736
46738
|
default: vue.withCtx(function () { return [
|
|
46737
46739
|
_hoisted_4
|
|
@@ -46778,20 +46780,23 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46778
46780
|
_: 2 /* DYNAMIC */
|
|
46779
46781
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["content"])
|
|
46780
46782
|
]),
|
|
46781
|
-
|
|
46782
|
-
|
|
46783
|
-
|
|
46784
|
-
|
|
46785
|
-
|
|
46786
|
-
|
|
46787
|
-
|
|
46788
|
-
|
|
46789
|
-
|
|
46790
|
-
|
|
46791
|
-
|
|
46792
|
-
|
|
46793
|
-
|
|
46794
|
-
|
|
46783
|
+
(!__props.disabled)
|
|
46784
|
+
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
46785
|
+
key: 0,
|
|
46786
|
+
class: "xrk-upload__item_icon__del",
|
|
46787
|
+
onClick: function () { return handleFileDel(index); }
|
|
46788
|
+
}, [
|
|
46789
|
+
vue.createVNode(vue.unref(BaseIcon), {
|
|
46790
|
+
color: "#606266",
|
|
46791
|
+
size: 16
|
|
46792
|
+
}, {
|
|
46793
|
+
default: vue.withCtx(function () { return [
|
|
46794
|
+
_hoisted_10
|
|
46795
|
+
]; }),
|
|
46796
|
+
_: 1 /* STABLE */
|
|
46797
|
+
})
|
|
46798
|
+
], 8 /* PROPS */, _hoisted_9))
|
|
46799
|
+
: vue.createCommentVNode("v-if", true)
|
|
46795
46800
|
]));
|
|
46796
46801
|
}), 128 /* KEYED_FRAGMENT */))
|
|
46797
46802
|
: vue.createCommentVNode("v-if", true),
|
|
@@ -46819,20 +46824,23 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
46819
46824
|
_: 1 /* STABLE */
|
|
46820
46825
|
})
|
|
46821
46826
|
], 8 /* PROPS */, _hoisted_13),
|
|
46822
|
-
|
|
46823
|
-
|
|
46824
|
-
|
|
46825
|
-
|
|
46826
|
-
|
|
46827
|
-
|
|
46828
|
-
|
|
46829
|
-
|
|
46830
|
-
|
|
46831
|
-
|
|
46832
|
-
|
|
46833
|
-
|
|
46834
|
-
|
|
46835
|
-
|
|
46827
|
+
(!__props.disabled)
|
|
46828
|
+
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
46829
|
+
key: 0,
|
|
46830
|
+
style: { "margin-left": "1em" },
|
|
46831
|
+
onClick: function () { return handleFileDel(index); }
|
|
46832
|
+
}, [
|
|
46833
|
+
vue.createVNode(vue.unref(BaseIcon), {
|
|
46834
|
+
color: "#fff",
|
|
46835
|
+
size: 18
|
|
46836
|
+
}, {
|
|
46837
|
+
default: vue.withCtx(function () { return [
|
|
46838
|
+
_hoisted_16
|
|
46839
|
+
]; }),
|
|
46840
|
+
_: 1 /* STABLE */
|
|
46841
|
+
})
|
|
46842
|
+
], 8 /* PROPS */, _hoisted_15))
|
|
46843
|
+
: vue.createCommentVNode("v-if", true)
|
|
46836
46844
|
])
|
|
46837
46845
|
]));
|
|
46838
46846
|
}), 128 /* KEYED_FRAGMENT */))
|