This section describes the navigator.
Attribute |
Type |
Default value |
Description |
Minimum version |
open-type |
String |
navigate |
Redirection method |
- |
hover-class |
String |
none |
Class attached when the URL is tapped. |
- |
hover-start-time |
Number |
- |
Time when the tapping state appears after tapping and multiple events, in milliseconds |
- |
hover-stay-time |
Number |
- |
The retention period of the clicked state after you release the finger, in milliseconds. |
- |
url |
String |
- |
Redirection URL in an application |
- |
open-type possible values
Attribute |
Description |
Minimum version |
navigate |
Corresponding to the function my.navigateTo. |
- |
redirect |
Corresponding to the function my.redirectTo. |
- |
switchTab |
Corresponding to the function my.switchTab. |
- |
navigateBack |
Corresponding to the function my.navigateBack. |
- |
Code sample
<!-- sample.axml -->
<view class="btn-area">
<navigator url="/page/navigate/navigate?title=navigate" hover-class="navigator-hover">redirect to new page</navigator>
<navigator url="../../redirect/redirect/redirect?title=redirect" open-type="redirect" hover-class="other-navigator-hover">open link in current tab</navigator>
<navigator url="/page/index/index" open-type="switchTab" hover-class="other-navigator-hover">switch tab</navigator>
</view>