el-upload清空文件列表
时间: 2023-09-07 21:11:20 浏览: 162
要清空el-upload组件的文件列表,可以通过使用ref属性来获取el-upload的实例,并调用实例的clearFiles()方法来实现。在布局代码中,给el-upload组件绑定ref属性,例如ref="uploadRef"。然后,在需要清空文件列表的地方,通过ref获取el-upload的实例,并调用clearFiles()方法即可。在Vue中,可以使用this.$refs来获取组件的实例,所以可以使用this.$refs.uploadRef.clearFiles()来清空el-upload组件的文件列表。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [el-upload清空已上传的文件列表](https://blog.csdn.net/qq_40896695/article/details/125080709)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [element-plus中el-upload清空上传列表](https://blog.csdn.net/qq_44423029/article/details/126012769)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文