css实现节流效果

// index.less
.pps {
    animation: css_throttle 2s step-end forwards;
}
.pps:active{
    animation: none;
}
@keyframes css_throttle {
    from {
        pointer-events: none;
    }
    to {
        pointer-events: all;
    }
}
// react 
import React, { Component } from 'react'
import { Button  } from 'antd';
import css_pps from './index.less'
export default class NoDone extends Component {
  actyions=()=>{
    console.log('点击了~~~~~')
  }
  render() {
    return (
      <div>
        <Button onClick={this.actyions} className={css_pps.pps} type="primary">12345</Button>
      </div>
    )
  }
}

// 参考链接:https://juejin.cn/post/7165828047520661534


你可能感兴趣的:(css,javascript,前端)