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 @   程序员冒冒  阅读(67)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示