@yoooloo42/joker 1.0.235 → 1.0.236
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/dist/index.cjs.js +11 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -23
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -42825,9 +42825,9 @@ const myProps_box = vue.reactive(unclassified.deepClone.deepMerge(
|
|
|
42825
42825
|
unclassified.deepClone.deepClone(ly0default.myProps),
|
|
42826
42826
|
props.myProps
|
|
42827
42827
|
));
|
|
42828
|
-
const fileList_box = vue.
|
|
42828
|
+
const fileList_box = vue.reactive([]);
|
|
42829
42829
|
props.modelValue.forEach((item, index) => {
|
|
42830
|
-
fileList_box.
|
|
42830
|
+
fileList_box.push({
|
|
42831
42831
|
name: item.substring(item.lastIndexOf('/') + 1) ?? 'Old_' + index,
|
|
42832
42832
|
url: item,
|
|
42833
42833
|
response: {
|
|
@@ -42838,18 +42838,6 @@ props.modelValue.forEach((item, index) => {
|
|
|
42838
42838
|
});
|
|
42839
42839
|
});
|
|
42840
42840
|
|
|
42841
|
-
const imgSrc = vue.computed(()=>{
|
|
42842
|
-
if(
|
|
42843
|
-
fileList_box.length>0 &&
|
|
42844
|
-
fileList_box[0].response &&
|
|
42845
|
-
fileList_box[0].response.data &&
|
|
42846
|
-
fileList_box[0].response.data.src
|
|
42847
|
-
){
|
|
42848
|
-
return fileList_box[0].response.data.src
|
|
42849
|
-
}
|
|
42850
|
-
return ''
|
|
42851
|
-
});
|
|
42852
|
-
|
|
42853
42841
|
const style = vue.reactive({
|
|
42854
42842
|
avatarBox: {
|
|
42855
42843
|
width: myProps_box.avatar.width,
|
|
@@ -42896,17 +42884,17 @@ const hdl = {
|
|
|
42896
42884
|
remove (file, fileList) { // 文件列表移除文件时的钩子
|
|
42897
42885
|
// 重置文件列表, 注意:通过使用splice保持响应性
|
|
42898
42886
|
// 因为只能上传一个图片,移除即清空
|
|
42899
|
-
fileList_box.
|
|
42887
|
+
fileList_box.splice(0, fileList_box.length);
|
|
42900
42888
|
// 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
|
|
42901
42889
|
emit("update:modelValue", []);
|
|
42902
42890
|
},
|
|
42903
42891
|
success (response, file, fileList) { // 上传
|
|
42904
42892
|
// 重置文件列表, 注意:通过使用splice保持响应性
|
|
42905
42893
|
// 只能上传一个图片
|
|
42906
|
-
fileList_box.
|
|
42894
|
+
fileList_box.splice(0, fileList_box.length, ...JSON.parse(JSON.stringify(fileList)));
|
|
42907
42895
|
if (response.code === 0) {
|
|
42908
42896
|
const arr = [];
|
|
42909
|
-
fileList_box.
|
|
42897
|
+
fileList_box.forEach(i=>{
|
|
42910
42898
|
arr.push(i.response.data.src);
|
|
42911
42899
|
});
|
|
42912
42900
|
// 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
|
|
@@ -42919,7 +42907,7 @@ const hdl = {
|
|
|
42919
42907
|
},
|
|
42920
42908
|
deleteAll () { // 删除全部已上传文件
|
|
42921
42909
|
// 重置文件列表, 注意:通过使用splice保持响应性
|
|
42922
|
-
fileList_box.
|
|
42910
|
+
fileList_box.splice(0, fileList_box.length);
|
|
42923
42911
|
// 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
|
|
42924
42912
|
emit("update:modelValue", []);
|
|
42925
42913
|
}
|
|
@@ -42936,8 +42924,8 @@ return (_ctx, _cache) => {
|
|
|
42936
42924
|
class: "avatar",
|
|
42937
42925
|
style: vue.normalizeStyle(style.avatarBox),
|
|
42938
42926
|
action: myProps_box.uploadUrl,
|
|
42939
|
-
"file-list": fileList_box
|
|
42940
|
-
"onUpdate:fileList": _cache[0] || (_cache[0] = $event => ((fileList_box)
|
|
42927
|
+
"file-list": fileList_box,
|
|
42928
|
+
"onUpdate:fileList": _cache[0] || (_cache[0] = $event => ((fileList_box) = $event)),
|
|
42941
42929
|
"show-file-list": false,
|
|
42942
42930
|
"before-upload": hdl.beforeUpload,
|
|
42943
42931
|
"on-preview": hdl.preview,
|
|
@@ -42945,10 +42933,10 @@ return (_ctx, _cache) => {
|
|
|
42945
42933
|
"on-success": hdl.success
|
|
42946
42934
|
}, {
|
|
42947
42935
|
default: vue.withCtx(() => [
|
|
42948
|
-
(
|
|
42936
|
+
(fileList_box.length>0 && fileList_box[0].response && fileList_box[0].response.data && fileList_box[0].response.data.src)
|
|
42949
42937
|
? (vue.openBlock(), vue.createElementBlock("img", {
|
|
42950
42938
|
key: 0,
|
|
42951
|
-
src:
|
|
42939
|
+
src: fileList_box[0].response.data.src,
|
|
42952
42940
|
class: "avatar",
|
|
42953
42941
|
style: vue.normalizeStyle(style.avatarImage)
|
|
42954
42942
|
}, null, 12 /* STYLE, PROPS */, _hoisted_1$a))
|
|
@@ -42965,7 +42953,7 @@ return (_ctx, _cache) => {
|
|
|
42965
42953
|
]),
|
|
42966
42954
|
_: 1 /* STABLE */
|
|
42967
42955
|
}, 8 /* PROPS */, ["style", "action", "file-list", "before-upload", "on-preview", "on-remove", "on-success"]),
|
|
42968
|
-
(fileList_box.
|
|
42956
|
+
(fileList_box.length>0 && fileList_box[0].response && fileList_box[0].response.data && fileList_box[0].response.data.src)
|
|
42969
42957
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
|
|
42970
42958
|
vue.createVNode(_component_el_button, {
|
|
42971
42959
|
size: "small",
|