Element ui el-upload 组件上传文件之后 file-list绑定的数据源依旧是空数组
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
el-upload 组件确实不支持自动更新 file-list,需要手动在上传成功和删除的回调中处理文件列表同步。
无奈只能手动实现,设置 on-success 和 on-remove 的回调处理。
<el-upload
:action="uploadUrl"
accept="image/jpeg,image/png"
multiple
:limit="5"
:data="uploadConfig"
:on-remove="(file, fileList) => { return handleRemoveByLogo1(file, fileList, 1); }"
:before-remove="beforeRemove1"
:before-upload="beforeUploadByLogo"
:on-exceed="handleExceed"
:on-preview="handlePreview1"
:on-success="(res, file, files) => { return handleSuccessLogo1(res, file, files, 1); }"
:file-list="imgJson[1].fileList"
list-type="picture-card">
<img src="./img/camera.png" />
<span>拍照确认</span>
</el-upload>
注意:
el-upload手动修改file-list之后无法一次上传多张照片会报
Uncaught TypeError: Cannot set property 'status' of null
GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45
7 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 7 个月前
更多推荐
已为社区贡献7条内容
所有评论(0)