vue-element简单封装验证倒数,调用,清除

    技术2022-07-11  74

    function getCodetimer(that,timer,show,count) { that.show = true; const TIME_COUNT = 60; if (!that.timer) { that.count = TIME_COUNT; that.show = true; that.timer = setInterval(() => { console.log(“1”) if (that.count > 0 && that.count <= TIME_COUNT) { that.count–; } else { that.show = false; clearInterval(that.timer); that.timer = null; } }, 1000) } };

    清除根据自己的情况来

    调用

    Processed: 0.018, SQL: 9