当我尝试单击按钮事件本身不会在移动设备中触发。我在桌面上工作正常。
我看到了一些帖子并尝试了 cursor ,z-Index 属性,但没有任何效果。
<div>
<button style ={{ cursor: 'pointer', zIndex : 1000 }}
onClick={ () => { console.log("ABC")} } >Button</button>
</div>
onclick 按钮应该打印“ABC”
添加postion: 'relative'
. 默认值为静态,将其从静态添加相对位置更改。
<div>
<button style={{ cursor: 'pointer', zIndex: 1000, position: 'relative' }}
onClick={() => { console.log("ABC") }} >Button</button>
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句