1.在button上绑定动态的disabled

<el-button type="primary" size="mini" @click="testCode" :disabled="codeDisabled">发送验证码</el-button>

2.在data中定义

codeDisabled: false,

3.在点击事件里加入定时器,60000为1分钟不能重复点击

 testCode() {
      this.codeDisabled = true
      setTimeout(()=>{
        this.codeDisabled = false;
      },60000)
  }

Logo

前往低代码交流专区

更多推荐