zoukankan      html  css  js  c++  java
  • 关闭定时器(setTimeout/clearTimeout|setInterval/clearInterval)

     1.1 开启Timeout程序: scope.setTimeout("functionName()" | functionHandle, timeValue) 返回值:timerID

      1.2 关闭Timeout程序: scope.clearTimeout(timerID);

      

      2.1 开启Interval程序: scope.setInterval("functionName()" | functionHandle, timeValue)  返回值:timerID

      2.2 关闭Interval程序: scope.clearInterval(timerID);

    60秒倒计时:

      let _this = this
          this.sendState = true;
         let time = setInterval(function(){
              _this.countdown-=1;
              if(_this.countdown==0){
                clearInterval(time)
                _this.sendState = false;
                _this.countdown = 60
              }
              console.log(_this.countdown)
          },1000)
    

      

  • 相关阅读:
    mybatis动态sql和分页
    mybatis入门
    IDEA
    Linux环境搭建
    svn
    jwt
    Vuex
    SPA项目开发之CRUD+表单验证
    JavaScript可视化框架——Echarts
    python+selenium六:隐式等待
  • 原文地址:https://www.cnblogs.com/lan-cheng/p/10008953.html
Copyright © 2011-2022 走看看