uni-app学习笔记之----页面跳转

1、声明式跳转

<navigator url="/pages/detail/detail">
     <button>跳转至详情页</button>
</navigator>
<navigator url="/pages/index/index" open-type="switchTab">
     <button>跳转至首页</button>
</navigator>

open-type:跳转方式

2、编程式跳转

注:

(1)跳转到tab页,需要用uni.switchTab(),关闭其他所有非tab页面

(2)uni.navigateTo()跳转非tab页面,可以返回

(3)uni.redirectTo()跳转非tab页面,关闭当前页面,不能返回

(4)uni.reLaunch() 可跳转任意页面,关闭其他所有页面,不能返回

 

posted @ 2023-02-24 11:53  程序员冒冒  阅读(59)  评论(0编辑  收藏  举报