程序调用了 setTimeout 方法,已经清理了定时器。为什么还会提示模拟器逻辑进程内存超过限制?
_timer() {
if (this.data.audio_status === '暂停' && this.pureData.second < this.data.curAudio.duration) {
if (this.data._timer) {
clearTimeout(this.data._timer);
this.data._timer = null;
};
this.data._timer = setTimeout(() => {
this._timerCount();
this._timer();
}, 1000);
}
},
组件按需注入
减少闭包使用
console.log关掉
不要全局保存页面的this指针