解决IOS设备 :active 伪类失效的方法

二狗 2024-12-19 发布
react
vue
css
html

查了下mozilla发现需要添加touchstart事件才可以,那我们给组件添加个空事件就好了

React
<span onTouchStart={null}>hello</span>
Vue
<span ontouchstart>hello</span>

然后就可以触发:active伪类了