两种方式导航跳转和传参
官方学习链接:https://uniapp.dcloud.io/component/navigator
一、声明式跳转
1.利用navigator进行跳转
跳转到普通页面(非tabBar页面)
<navigator url="/pages/detail/detail">跳转至详情页</navigator>
跳转到tabBar页面 //添加open-type
<navigator url="/pages/wedmap/wedmap" open-type="switchTab">跳转至地图页</navigator>
open-type 有效值
值 | 说明 | |
---|---|---|
navigate | 对应 uni.navigateTo 的功能 | |
redirect | 对应 uni.redirectTo 的功能 | |
switchTab | 对应 uni.switchTab 的功能 | |
reLaunch | 对应 uni.reLaunch 的功能 | |
navigateBack | 对应 uni.navigateBack 的功能 | |