React中阻止事件冒泡

刘听风 168 2022-08-28
  // 阻止冒泡
  function handleSaleItem(e: SyntheticEvent,item:any) {
    e.stopPropagation()
    e.nativeEvent.stopImmediatePropagation()
  }