@yoooloo42/joker 1.0.234 → 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 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +11 -11
- 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: {
|
|
@@ -42884,17 +42884,17 @@ const hdl = {
|
|
|
42884
42884
|
remove (file, fileList) { // 文件列表移除文件时的钩子
|
|
42885
42885
|
// 重置文件列表, 注意:通过使用splice保持响应性
|
|
42886
42886
|
// 因为只能上传一个图片,移除即清空
|
|
42887
|
-
fileList_box.
|
|
42887
|
+
fileList_box.splice(0, fileList_box.length);
|
|
42888
42888
|
// 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
|
|
42889
42889
|
emit("update:modelValue", []);
|
|
42890
42890
|
},
|
|
42891
42891
|
success (response, file, fileList) { // 上传
|
|
42892
42892
|
// 重置文件列表, 注意:通过使用splice保持响应性
|
|
42893
42893
|
// 只能上传一个图片
|
|
42894
|
-
fileList_box.
|
|
42894
|
+
fileList_box.splice(0, fileList_box.length, ...JSON.parse(JSON.stringify(fileList)));
|
|
42895
42895
|
if (response.code === 0) {
|
|
42896
42896
|
const arr = [];
|
|
42897
|
-
fileList_box.
|
|
42897
|
+
fileList_box.forEach(i=>{
|
|
42898
42898
|
arr.push(i.response.data.src);
|
|
42899
42899
|
});
|
|
42900
42900
|
// 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
|
|
@@ -42907,7 +42907,7 @@ const hdl = {
|
|
|
42907
42907
|
},
|
|
42908
42908
|
deleteAll () { // 删除全部已上传文件
|
|
42909
42909
|
// 重置文件列表, 注意:通过使用splice保持响应性
|
|
42910
|
-
fileList_box.
|
|
42910
|
+
fileList_box.splice(0, fileList_box.length);
|
|
42911
42911
|
// 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
|
|
42912
42912
|
emit("update:modelValue", []);
|
|
42913
42913
|
}
|
|
@@ -42924,8 +42924,8 @@ return (_ctx, _cache) => {
|
|
|
42924
42924
|
class: "avatar",
|
|
42925
42925
|
style: vue.normalizeStyle(style.avatarBox),
|
|
42926
42926
|
action: myProps_box.uploadUrl,
|
|
42927
|
-
"file-list": fileList_box
|
|
42928
|
-
"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)),
|
|
42929
42929
|
"show-file-list": false,
|
|
42930
42930
|
"before-upload": hdl.beforeUpload,
|
|
42931
42931
|
"on-preview": hdl.preview,
|
|
@@ -42933,10 +42933,10 @@ return (_ctx, _cache) => {
|
|
|
42933
42933
|
"on-success": hdl.success
|
|
42934
42934
|
}, {
|
|
42935
42935
|
default: vue.withCtx(() => [
|
|
42936
|
-
(fileList_box.
|
|
42936
|
+
(fileList_box.length>0 && fileList_box[0].response && fileList_box[0].response.data && fileList_box[0].response.data.src)
|
|
42937
42937
|
? (vue.openBlock(), vue.createElementBlock("img", {
|
|
42938
42938
|
key: 0,
|
|
42939
|
-
src: fileList_box
|
|
42939
|
+
src: fileList_box[0].response.data.src,
|
|
42940
42940
|
class: "avatar",
|
|
42941
42941
|
style: vue.normalizeStyle(style.avatarImage)
|
|
42942
42942
|
}, null, 12 /* STYLE, PROPS */, _hoisted_1$a))
|
|
@@ -42953,7 +42953,7 @@ return (_ctx, _cache) => {
|
|
|
42953
42953
|
]),
|
|
42954
42954
|
_: 1 /* STABLE */
|
|
42955
42955
|
}, 8 /* PROPS */, ["style", "action", "file-list", "before-upload", "on-preview", "on-remove", "on-success"]),
|
|
42956
|
-
(fileList_box.
|
|
42956
|
+
(fileList_box.length>0 && fileList_box[0].response && fileList_box[0].response.data && fileList_box[0].response.data.src)
|
|
42957
42957
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
|
|
42958
42958
|
vue.createVNode(_component_el_button, {
|
|
42959
42959
|
size: "small",
|