navigator的open-type跳转

场景:

	<view class="login-bottom-mudoler">
		<view class="login-bottom">
			<view class="font_size"><navigator url="../egaiyi-login-phone/egaiyi-login-phone?url={{pagesUrl}}" open-type="redirect">其他方式登入 ></navigator></view>
			<view class="font_size"><navigator url="../../register/egaiyi-reset-password/egaiyi-reset-password" open-type="redirect">忘记密码 ></navigator></view>
		</view>
	</view>

navigator的open-type属性 可选值 'navigate'、'redirect'、'switchTab'

对应于wx.navigateTo、wx.redirectTo、wx.switchTab的功能

open-type="navigate"等价于API的 wx.navigateTo 而wx.navigateTo的url是需要跳转的应用内非 tabBar 的页面的路径

open-type="redirect"等价于API的 wx.redirectTo 而wx.redirectTo的url是需要跳转的应用内非 tabBar 的页面的路径

open-type="switchTab"等价于API的 wx.switchTab而wx.switchTab的url是需要跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面

最后一个switchTab事件触发以后 把前面的页面都关闭了

猜你喜欢

转载自blog.csdn.net/weixin_38245489/article/details/81663396
今日推荐