WeChat applet's API for monitoring page routing changes

// #ifdef MP-WEIXIN
			wx.onAppRoute((res) => {
			     console.log('路由监听',res)   
				if (res.openType === 'switchTab') {
					// #ifdef MP-WEIXIN
					wx.hideTabBar()
					// #endif
				}
			})
			// #endif

The applet has an API that can listen for global route jumps.

Guess you like

Origin blog.csdn.net/cwb_2120/article/details/132919920