求助,js事件穿透

js事件穿透如何实现?除了使用pointer-events:none

javascript
99 views
Comments
登录后评论
Sign In
·
import React, { FC } from 'react';

const Index: FC = () => {

  return (
    <div onClick={e => {
      e.stopPropagation();
      // do something
    }}/>
  );
};

stopPropagation 就行了

·

不理解问题,是点击穿透还是事件冒泡之类?