<template> <el-upload :action="uploadUrl" :on-success="handleSuccess" :on-exceed="handleExceed" :file-list="fileList" multiple> <el-button size="small" type="primary">点击上传</el-button> </el-upload> </template> <script> export default { data() { return { uploadUrl: 'your-upload-url', fileList: [], allFilesUploaded: false }; }, methods: { handleSuccess(response, file, fileList) { // 单个文件上传成功后的回调 // 检查所有文件是否已上传完毕 if (this.fileList.length === fileList.length) { this.allFilesUploaded = true; // 执行其他逻辑,例如关闭上传窗口或提示用户 } }, handleExceed(files, fileList) { // 当超出最大上传数量时的回调 // 可以用来处理超出文件数量的逻辑 } } }; </script>
标签:文件,allFilesUploaded,Upload,fileList,element,上传 From: https://www.cnblogs.com/tlfe/p/18089254