@yoooloo42/joker 1.0.237 → 1.0.239

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 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
- let fileList_box = vue.reactive([]);
42828
+ let fileList_box = vue.ref([]);
42829
42829
  props.modelValue.forEach((item, index) => {
42830
- fileList_box.push({
42830
+ fileList_box.value.push({
42831
42831
  name: item.substring(item.lastIndexOf('/') + 1) ?? 'Old_' + index,
42832
42832
  url: item,
42833
42833
  response: {
@@ -42838,6 +42838,16 @@ props.modelValue.forEach((item, index) => {
42838
42838
  });
42839
42839
  });
42840
42840
 
42841
+ console.log('joker测试 000', props.modelValue);
42842
+ console.log('joker测试 111', fileList_box.value);
42843
+
42844
+ vue.watch(()=>props.modelValue, (newVal, oldVal) => {
42845
+ console.log('joker测试 222', newVal);
42846
+ });
42847
+ vue.watch(()=>fileList_box.value, (newVal, oldVal) => {
42848
+ console.log('joker测试 333', newVal);
42849
+ });
42850
+
42841
42851
  const style = vue.reactive({
42842
42852
  avatarBox: {
42843
42853
  width: myProps_box.avatar.width,
@@ -42884,17 +42894,17 @@ const hdl = {
42884
42894
  remove (file, fileList) { // 文件列表移除文件时的钩子
42885
42895
  // 重置文件列表, 注意:通过使用splice保持响应性
42886
42896
  // 因为只能上传一个图片,移除即清空
42887
- fileList_box.splice(0, fileList_box.length);
42897
+ fileList_box.value.splice(0, fileList_box.value.length);
42888
42898
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42889
42899
  emit("update:modelValue", []);
42890
42900
  },
42891
42901
  success (response, file, fileList) { // 上传
42892
42902
  // 重置文件列表, 注意:通过使用splice保持响应性
42893
42903
  // 只能上传一个图片
42894
- fileList_box.splice(0, fileList_box.length, ...JSON.parse(JSON.stringify(fileList)));
42904
+ fileList_box.value.splice(0, fileList_box.value.length, ...JSON.parse(JSON.stringify(fileList)));
42895
42905
  if (response.code === 0) {
42896
42906
  const arr = [];
42897
- fileList_box.forEach(i=>{
42907
+ fileList_box.value.forEach(i=>{
42898
42908
  arr.push(i.response.data.src);
42899
42909
  });
42900
42910
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
@@ -42907,7 +42917,7 @@ const hdl = {
42907
42917
  },
42908
42918
  deleteAll () { // 删除全部已上传文件
42909
42919
  // 重置文件列表, 注意:通过使用splice保持响应性
42910
- fileList_box.splice(0, fileList_box.length);
42920
+ fileList_box.value.splice(0, fileList_box.value.length);
42911
42921
  // 触发 update:modelValue 事件更新父组件的 v-model 绑定的值
42912
42922
  emit("update:modelValue", []);
42913
42923
  }