@yoooloo42/joker 1.0.235 → 1.0.237

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