uni-simple-router icon indicating copy to clipboard operation
uni-simple-router copied to clipboard

2.0.8-beta.4 在微信小程序端劫持生命周期无效

Open SilurianYang opened this issue 3 years ago • 1 comments

问题描述 微信小程序在未放行前置守卫的情况下,依然执行了 index.vue 下的 onload 生命周期

复现步骤

  1. npm i
  2. npm run dev:mp-weixin
  3. 查看console信息 onload 被执行
// 全局路由前置守卫
function time() {
	return new Promise(res => {
		setTimeout(() => {
			console.log('倒计时结束')
			res()
		}, 2000)
	})
}
//全局路由前置守卫
router.beforeEach(async (to, from, next) => {
	console.log('跳转前置守卫')
	await time()
	// next();
});

系统信息:

  • 发行平台:微信小程序
  • uni-simple-router版本: v2.0.8-beta.4 demo.zip

SilurianYang avatar Apr 12 '22 09:04 SilurianYang

已修复

SilurianYang avatar Jul 24 '22 08:07 SilurianYang