1.0.11 • Published 2 years ago

@uni/navigate v1.0.11

Weekly downloads
6,145
License
BSD-3-Clause
Repository
github
Last release
2 years ago

navigate

npm

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

PropertyTypeDescriptionrequiredDefault
optionsobjectPush function argumentstrue-
options.urlstringThe page URL.true-
options.successFunction The callback function for a successful API callfalse-
options.failFunction The callback function for a failed API callfalse-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

back(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobjectPop function argumentsfalse-
options.successFunction The callback function for a successful API callfalse-
options.failFunction The callback function for a failed API callfalse-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

go(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobjectGo function argumentstrue-
options.stepnumberThe number of forward steps is positive and only supports the web, and the number of backward steps is negative.true-
options.successFunction The callback function for a successful API callfalse-
options.failFunction The callback function for a failed API callfalse-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

replace(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobjectGo function argumentstrue-
options.urlnumberThe page URL.true-
options.successFunction The callback function for a successful API callfalse-
options.failFunction The callback function for a failed API callfalse-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

reLaunch(options)

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobjectGo function argumentstrue-
options.urlnumberThe page URL.true-
options.successFunction The callback function for a successful API callfalse-
options.failFunction The callback function for a failed API callfalse-
options.completeFunction The callback function used when the API call completed (always executed whether the call succeeds or fails)-

switchTab(options)

Does not support web

Arguments

PropertyTypeDescriptionrequiredDefault
optionsobjectFunction optionsYes-
options.urlstringPage urlYes-
options.successFunction Callback on successNo-
options.failFunction Callback on failNo-
options.completeFunction Callback on completeNo-