子组件
methods: {
getName(){
this.$emit('callParentFunction', file, fileList, val => {
console.log(val) // 小明
})
}
}
父组件
data(){
return {
name: '小明'
}
}
methods: {
callParentFunction(file, fileList, callBack){
console.log(file)
console.log(file)
callBack(this.name)
}
}
网友评论