在 父组件中 传递参数的时候 使用 回掉函数的形式 将 函数逻辑 传递给子组件
子组件中进行接收 --- 在组件的 对应逻辑中调用即可
demo
父组件 传递 回掉函数
CardActivity({ accumulatePointActivity: this.cardInfo?.accumulatePointActivity ,getCardInfo:()=>{
this.getCardInfo(this.recommendedShopId??'')
}})

子组件 接受回调函数 并且调用

子组件调用

!!!!带参数的接受形式 demo
onAddProduct: (product: MxbcProduct) => void = () => {
}

1032

被折叠的 条评论
为什么被折叠?



