uni-app导航跳转

本文介绍了uni-app中不同类型的导航跳转方法,包括uni.navigateTo用于保留当前页面并跳转,uni.switchTab用于切换到tabbar页面,uni.redirectTo用于关闭当前页面并跳转,以及uni.navigateBack用于返回上一页面。每个方法的参数说明和使用场景也进行了详细说明。
摘要由CSDN通过智能技术生成

Uni中的导航跳转

navigator

页面链接
属性

属性名 默认值 说明
url 应用内的跳转链接,值为相对路径或绝对路径,如:"…/first/first","/pages/first/first",注意不能加 .vue 后缀
open-type navigate 跳转方式
delta 当 open-type 为 ‘navigateBack’ 时有效,表示回退的层数
animation-type pop-in/out 当 open-type 为 navigate、navigateBack 时有效
animation-duration 300 窗口显示/关闭动画的持续时间
hover-class navigator-hover 指定点击时的样式类,当hover-class="none"时,没有点击态效果
hover-start-time 50 按住后多久出现点击态,单位毫秒
hover-stay-time 600 手指松开后点击态保留时间,单位毫秒
target self 在哪个小程序目标上发生跳转,默认当前小程序,值域self/miniProgram

open-type有效值

说明
navigate 对应 uni.navigateTo 的功能
redirect 对应 uni.redirectTo 的功能
switchTab 对应 uni.switchTab 的功能
reLaunch 对应 uni.reLaunch 的功能
navigateBack 对应 uni.navigateBack 的功能
exit 退出小程序,target="miniProgram"时生效

页面跳转
跳转非tabbar页面

<template>
 <view>
 	<view>导航跳转学习</view>
 	<navigator url="/pages/detail/index">跳转至详情页面</navigator>
 </view>
</template>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值