解决IOS设备 :active 伪类失效的方法
二狗与2020/03/02发布
react
vue
css
html
查了下 mozilla 发现需要添加touchstart
事件才可以,那我们给组件添加个空事件就好了
react
<span onTouchStart={null}>hello</span>
vue
<span ontouchstart>hello</span>
然后就可以触发:active
伪类了
查了下 mozilla 发现需要添加touchstart
事件才可以,那我们给组件添加个空事件就好了
<span onTouchStart={null}>hello</span>
<span ontouchstart>hello</span>
然后就可以触发:active
伪类了