CSS防止多次点击

2023-06-29  本文已影响0人  hao_developer
.pause-content {
  display: inline-block;
  white-space: normal;
  background: pink;
  box-sizing: border-box;
  
  animation: throttle 2s step-end forwards;
}

.pause-content:active{
  animation: none;
}

@keyframes throttle{
  from{
    pointer-events: none;
  }
  to{
    pointer-events: all;
  }
}
<view bindtap="clickHandler" class="pause-content" style="margin: 100rpx;">按钮</view>
  clickHandler(){
    console.log('-----------');
  }
上一篇 下一篇

猜你喜欢

热点阅读