element upload 覆盖上传

Posted auserroot

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了element upload 覆盖上传相关的知识,希望对你有一定的参考价值。

实现element upload 文件覆盖上传

根据官方文档给出的属性和方法总结几种解决方案

官方文档:



//on-progress abort 或 file-list
//设置 upload 组件 ref='upload'
onProgress(file,fileList)
	//file-list 
	fileList.length>1?fileList.splice(0,1):''
	//判断条件 + abort
	if(xxx)
		this.$refs.upload.abort()
	


// on-change   
onChange(file,fileList)
	//file-list 
	fileList.length>1?fileList.splice(0,1):''
	//判断条件 + abort
	if(xxx)
		this.$refs.upload.abort()
	


//limit + on-exceed 通过限制上传文件数量和对应的钩子处理

以上是关于element upload 覆盖上传的主要内容,如果未能解决你的问题,请参考以下文章