@uni/navigate
v1.0.11
Published
[![npm](https://img.shields.io/npm/v/@uni/navigate.svg)](https://www.npmjs.com/package/@uni/navigate)
Downloads
1,670
Readme
navigate
Route navigation capability implementation.
Support
Install
$ npm install @uni/navigate --save
Usage
import navigate from '@uni/navigate';
// How to use it in quickapp
// import chooseImage from '@uni/navigate/lib/quickapp;
navigate.push({
url: 'https://www.taobao.com/'
}).then(() => {
});
navigate.back().then(() => {
});
navigate.go({
step: -1
}).then(() => {
});
navigate.replace({
url: 'https://www.taobao.com/'
}).then(() => {
});
navigate.reLaunch({
url: 'https://www.taobao.com/'
}).then(() => {
});
Methods
push(options)
Arguments
| Property | Type | Description | required | Default |
| ---------------- | --------- | ---------------------------------------------------------------------------------- | :------: | :-----: |
| options | object
| Push function arguments | true | - |
| options.url | string
| The page URL. | true | - |
| options.success | Function
| The callback function for a successful API call | false | - |
| options.fail | Function
| The callback function for a failed API call | false | - |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | 否 | - |
back(options)
Arguments
| Property | Type | Description | required | Default |
| ---------------- | --------- | ---------------------------------------------------------------------------------- | :------: | :-----: |
| options | object
| Pop function arguments | false | - |
| options.success | Function
| The callback function for a successful API call | false | - |
| options.fail | Function
| The callback function for a failed API call | false | - |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | 否 | - |
go(options)
Arguments
| Property | Type | Description | required | Default |
| ---------------- | --------- | ---------------------------------------------------------------------------------------------------------------- | :------: | :-----: |
| options | object
| Go function arguments | true | - |
| options.step | number
| The number of forward steps is positive and only supports the web, and the number of backward steps is negative. | true | - |
| options.success | Function
| The callback function for a successful API call | false | - |
| options.fail | Function
| The callback function for a failed API call | false | - |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | 否 | - |
replace(options)
Arguments
| Property | Type | Description | required | Default |
| ---------------- | --------- | ---------------------------------------------------------------------------------------------------------------- | :------: | :-----: |
| options | object
| Go function arguments | true | - |
| options.url | number
| The page URL. | true | - |
| options.success | Function
| The callback function for a successful API call | false | - |
| options.fail | Function
| The callback function for a failed API call | false | - |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | 否 | - |
reLaunch(options)
Arguments
| Property | Type | Description | required | Default |
| ---------------- | --------- | ---------------------------------------------------------------------------------------------------------------- | :------: | :-----: |
| options | object
| Go function arguments | true | - |
| options.url | number
| The page URL. | true | - |
| options.success | Function
| The callback function for a successful API call | false | - |
| options.fail | Function
| The callback function for a failed API call | false | - |
| options.complete | Function
| The callback function used when the API call completed (always executed whether the call succeeds or fails) | 否 | - |
switchTab(options)
Does not support web
Arguments
| Property | Type | Description | required | Default |
| ---------------- | --------- | ------ | :---: | :----: |
| options | object
| Function options | Yes | - |
| options.url | string
| Page url | Yes | - |
| options.success | Function
| Callback on success | No | - |
| options.fail | Function
| Callback on fail | No | - |
| options.complete | Function
| Callback on complete | No | - |