子组件入参
this.$emit('uploadSuccess',res);
父组件入参
<Up @uploadSuccess="uploadLogoImage(index,arguments)" />
方法取参
uploadLogoImage(){
console.log(arguments[0]); //index
console.log(arguments[1][0]); //res
},
子组件入参
this.$emit('uploadSuccess',res);
父组件入参
<Up @uploadSuccess="uploadLogoImage(index,arguments)" />
方法取参
uploadLogoImage(){
console.log(arguments[0]); //index
console.log(arguments[1][0]); //res
},
本文标题:使用$emit传参:如何同时接收父组件和子组件的参数
本文链接:https://www.haomeiwen.com/subject/dtrhgktx.html
网友评论