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>