Sub-component:
props {
onSuccess: {
type: Function,
default: noop
}
}
methods: {
handleSuccess(res, rawFile) {
this.onSuccess(res, file, this.uploadFiles);
}
}
parent component uses:
<el-upload
class="avatar-uploader upload"
:action="cloudUrl"
:on-success="handleUrl">
methods: {
handleUrl(response, file, fileList) {
}
}
suppose you do not change the additional parameters of the parent component of the child component:
methods: {
handleUrl(response, file, fileList, extra) {
}
}
: how should on-success= "handleUrl" be changed to pass parameters?
if the child component uses emit, the parent component can use .arguments to represent the old parameters, and the props function can be used again. Neither can $event. Ask for advice