dlt.navigateBack
Introduction
dlt.navigateBack
is an API used to close the current page and return to the previous page or multiple previous pages.
Parameters
Object object
Property | Type | Default Value | Required | Description |
---|---|---|---|---|
delta | number | No | The number of pages to navigate back, starting from -1. | |
autoExit | boolean | No | Whether to automatically exit the mini-program when navigating back to the last page. | |
params | string | No | Additional data in the form of an Object. | |
success | function | No | Callback function for a successful API call. | |
fail | function | No | Callback function for a failed API call. | |
complete | function | No | Callback function that is called when the API call is complete (whether successful or not). |
Example Code
dlt.navigateBack({
delta: -1,
autoExit: true,
params: JSON.stringify({ a: 1 }),
success(res) {
console.log('success: ', res);
},
});