页面或者函数完成后的善后工作
fe:

  1. setTimeout() clearTimeout()
  2. setInterval() clearInterval()
  3. uni.showLoading() uni.hideLoading()
  4. this. o n ( ′ f u n c ′ ) t h i s . on('func') this. on(func)this.off(‘func’)
//settimeout
				var id = setTimeout(() => {
					uni.showToast({
						title: "success"
					})
				}, 1000);
				clearTimeout(id) //如果异步操作没有触发,需要销毁id,提前销毁不会执行
			 
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐