vue :没有全局变量的计数器
created:
created () { let num = null this.mFun(num) },
methods:
methods:{ mFun(m){ if (m === null) { m = 0 } else { m++ } setTimeout(()=>{ console.log(m) this.mFun(m) },1000) }, }
posted on 2018-07-18 10:35 fox_charon 阅读(180) 评论(0) 收藏 举报
浙公网安备 33010602011771号