如:upload上传组件,on-remove属性绑定方法,并传参
如图,on-remove默认的参数是file和fileList,当想传自定义参数时,可采用如下方法::on-remove="((file, fileList)=>{handleRemove(file, fileList, 2)})",即:
<el-upload
accept="video/mp4,video/flv"
name="file"
action="string"
:on-change="onchangevideo"
:http-request="((e)=>{uploadFile(e, 2)})"
:on-remove="((file, fileList)=>{handleRemove(file, fileList, 2)})"
list-type="text">
其中,file和fileList是默认参数,2为自定义传参
接收参数时,其中type打印为2
//图片删除
handleRemove(file, fileList, type) {
console.log(type, 'type')
}