子组件传参:
const emit = defineEmits(['自定义事件名字A'])
// 给父组件传参
emit('自定义事件名字A',数据)
父组件接收参数:
<子组件标签名 @自定义事件名字A="getRecentRecoding"></子组件标签名>
// 父组件接收数据
function getRecentRecoding (val:any){
console.log('近期流水:', val);
}
子组件传参:
const emit = defineEmits(['自定义事件名字A'])
// 给父组件传参
emit('自定义事件名字A',数据)
父组件接收参数:
<子组件标签名 @自定义事件名字A="getRecentRecoding"></子组件标签名>
// 父组件接收数据
function getRecentRecoding (val:any){
console.log('近期流水:', val);
}