element ui上傳組件,開啟多圖上傳時(shí)報(bào)錯(cuò),列表顯示一個(gè)成功,實(shí)際圖片都已經(jīng)上傳成功。
報(bào)錯(cuò)如下:
Uncaught TypeError: Cannot set properties of null (setting 'status')
解決方法
:file-list="imageList"
指定文件列表為imageList
另外定義images數(shù)組字段接收服務(wù)器返回值
將顯示和數(shù)據(jù)區(qū)分,提交表單時(shí)只需要提交images數(shù)組。
handleImageSuccess(res, file, fileList) {
this.imageList = fileList;
this.images.push({
name: file.name,
url: file.url,
path: res.data.path
});
},
- 版權(quán)所有:奇站網(wǎng)絡(luò) 轉(zhuǎn)載請(qǐng)注明出處
- 廈門奇站網(wǎng)絡(luò)科技有限公司,專業(yè)提供網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站建設(shè),小程序開發(fā),系統(tǒng)定制開發(fā)。
- 軟件開發(fā)咨詢熱線:吳小姐 13313868605