uni-app学习笔记之页面销毁处理

页面或者函数完成后的善后工作
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,提前销毁不会执行
			 

你可能感兴趣的:(uni-app,javascript,vue.js,前端)