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