iview批量上傳on success只觸發一次

2021-10-09 09:04:25 字數 1331 閱讀 3380

如下面**,多選時,多個檔案只顯示了第乙個上傳的。before-upload 會觸發多次,但是on-success只觸發了一次。上傳完成的列印也有多次的。證明多個檔案已經上傳成功了

<

upload

ref=

"upload"

type

="drag"

:show-upload-list

="showuploadlist"

:format

="format"

multiple

:before-upload

="onbeforeupload"

:on-success

="onsuccesshandler"

:on-error

="onerrorhandler"

:max-size

="maxsize"

action

="/"

>

<

divv-for

="item in filelist"

>

***x

<

/div

>

<

/upload

>

onbeforeupload

(file)

onsuccesshandler

(response, file))}

,function

beforecosupload

(self, file, beforecheck)

,onsuccess

(data)

,onerror

(err, data)

}let result =

cosupload

(obj)

}return

newpromise

((resolve, reject)

=>

)}

最後發現是在後面 uploadvue.post 裡面的uploadvue.clearfiles() 影響到了。所以處理一下,加個變數,多選時不去執行清除設定 uploadvue.clearfiles()

return

beforecosupload

(this

, file, beforecheck,

false

)function

beforecosupload

(self, file, beforecheck,isclear =

true)}

}

iview原始碼修改及上傳npm

1 沒有先npm install就npm publish報錯 2 報錯400是因為我本地連線的是私服,所以需要用nrm切換到npm服務 iview test1 3.5.4 dev f 20tdcomponents test iview原始碼 iview 剛開始執行npm run build報錯了,再...

FTP批量上傳

ftp預設的檔案傳輸方式是基於 ascii 碼的,如果要以二進位制格式傳輸檔案,那麼要先輸入 bin 命令,然後再用 put 或get 命令。1 如果需要傳輸乙個目錄裡的所有檔案,那麼可以使用 mput 或mget 命令來替代 put 或get 命令。注意 需要使用prompt off命令,來關閉互...

spring mvc檔案上傳與批量上傳

1.匯入新增的jar包 commons fileupload 1.3.1.jar commons io 2.4.jar 2.配置spring mvc檔案上傳解析器 class org.springframework.web.multipart.commons.commonsmultipartreso...