Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliang-wt committed Jul 29, 2023
1 parent 92efdf4 commit 82f56f9
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const header = computed(() => {
return { Authorization: `Bearer ${Local.get('token')}` }
})
watch(filevalue, async () => {
if(!filevalue.value){
debugger;
if(!filevalue.value){
files.value = [];
return;
}
Expand All @@ -56,7 +57,6 @@ watch(filevalue, async () => {
files.value = [];
}
if (props.multi == false) {

let fv = null;
if (files.value && files.value.length > 0) {
fv = files.value[0].FileId;
Expand Down Expand Up @@ -110,7 +110,7 @@ const onSuccess = (res: any, uploadFile: any, uploadFiles: any) => {
}
}

const onRemove = (file: any) => {
const onRemove = (file: any) => {
fileApi().deleteFile(file.FileId);
const f = files.value;
if (f) {
Expand All @@ -123,8 +123,13 @@ const onRemove = (file: any) => {
index--;
}
}
}
filevalue.value = f.map((item:any)=>{return {FileId: item.FileId, ID: item.keyID}});
}
if (props.multi == false) {
filevalue.value = null;
}
else {
filevalue.value = f.map((item: any) => { return { FileId: item.FileId, ID: item.keyID } });
}
}
// 暴露变量
defineExpose({
Expand Down

0 comments on commit 82f56f9

Please sign in to comment.