跳到主要内容

navigator

功能描述

页面链接。

组件属性

属性名类型默认值说明
urlString当前小程序内的跳转链接
open-typeStringnavigate跳转方式
deltaNumber当 open-type 为 'navigateBack' 时有效,表示回退的层数

open-type 有效值:

说明
navigate对应 mgtv.navigateTo
redirect对应 mgtv.redirectTo 的功能
switchTab对应 mgtv.switchTab 的功能
reLaunch对应 mgtv.reLaunch 的功能
navigateBack对应 mgtv.navigateBack 的功能

示例代码

/** 修改默认的navigator点击态 **/
.navigator-hover {
color:blue;
}
/** 自定义其他点击态样式类 **/
.other-navigator-hover {
color:red;
}
<navigator url="navigate?title=navigate" hover-class="ohter-navigator">
<button type="default">跳转到新页面</button>
</navigator>
<navigator url="redirect?title=redirect" open-type="redirect" hover-class="other-navigator-hover">
<button type="default">在当前页打开</button>
</navigator>

预览

nav