element [Bug Report] el-upload中slot不能获取到fileList进行slot插槽的重写

ao218c7q  于 4个月前  发布在  其他
关注(0)|答案(3)|浏览(88)

Element UI version

0.1.0

OS/Browsers version

win10

Vue version

2.5.22

https://elementui.github.io/issue-generator/#/zh-CN

Steps to reproduce

通过slot=”{file}“只能获取单文件,当多文件上传时,需要自定义上传列表时获取不到fileList

What is Expected?

希望能将fileList也暴露出来,做到更方便的自定义列表文件。

What is actually happening?

暴露出可操作的fileList

66bbxpm5

66bbxpm51#

现在只能再remove和change时自己手动维护fileList

j1dl9f46

j1dl9f462#

现在只能再remove和change时自己手动维护fileList

你可以通过定义一个ref指向el-upload组件, ,然后通过 this.$refs.uploadRef.uploadFiles 拿到内部维护的 fileList。

但是要注意里面 file 和 rawFile 区别。rawFile 上并没有维护文件状态 status

nukf8bse

nukf8bse3#

i guess this would be a pretty small feature but very handy.
I've looked into the code and this seems enough to me (note that it's just a proposal and not a definite PR)
#21733

相关问题