vue 点击倒计时 ajax 封装
发布时间:2020-12-16 03:00:02 所属栏目:百科 来源:网络整理
导读:方法: function (){ var that = this ; if (that.time == 0 ) { that.disabled = false ; that.text ="点击获取" ; that.time =120 ; return ; } else { that.disabled = true ; that.text = that.time + "s" ; that.time -- ; } setTimeout( function () {
方法:function(){ var that = this; if (that.time == 0) { that.disabled = false; that.text ="点击获取"; that.time =120; return; } else { that.disabled = true; that.text = that.time + "s"; that.time--; } setTimeout(function () { that.setTime(); },1000); },SendMsg:function(){ var that = this; Comm.runebws("URL",data,"POST",function(result){ if(result.code==0){ that.setTime(); //重新开始计时 }else{ return } },function(e){ if(e&&e.message){ }else{ return } },1); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |