navigator
功能描述
页面链接。
组件属性
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
url | String | 当前小程序内的跳转链接 | |
open-type | String | navigate | 跳转方式 |
delta | Number | 当 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>