子組件:props { onSuccess: { type: Function, default: noop }}methods: { handleSuccess(res, rawFile) { this.onSuccess(res, file, this.uploadFiles); }}父組件使用:<el-upload class="avatar-uploader upload" :action="cloudUrl" :on-success="handleUrl">methods: { handleUrl(response, file, fileList) { }}假設(shè)不改變子組件的,父組件的增加額外參數(shù):methods: { handleUrl(response, file, fileList, extra) { }}:on-success="handleUrl"應(yīng)該怎么改傳參?如果子組件用emit的話,父組件可以用...arguments代表舊的參數(shù),用props傳函數(shù)再用...arguments不行,$event也不行。求教 評論邀請回答
vue:父組件使用props傳函數(shù)如何增加額外參數(shù)
呼啦一陣風(fēng)
2019-03-28 10:15:37