Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| url | String | Yes | Path to the tab bar page (no query parameters allowed) |
| success | Function | No | Callback on success |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
Code Example
Basic Usage
With Callbacks
Configuration
The target page must be defined inapp.json:
Important Notes
Differences from Other Navigation APIs
| API | Behavior |
|---|---|
my.switchTab | Navigates to tab page, closes non-tab pages |
my.navigateTo | Opens new page, keeps current page |
my.redirectTo | Replaces current page |
my.reLaunch | Closes all pages, opens target page |
Related APIs
my.navigateTo
Navigate to a new page
my.setTabBarStyle
Customize tab bar style