How to add extra parameters to vue: parent components using props pass functions

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

Mar.28,2021

I see.
on-success= "(response, file, fileList) = > {handleUrlSuccess (response, file, fileList, 233)}"


the subject asks and answers himself, which is interesting, .

Menu