HomeDocs
Skip to main content

dlt.navigateToMiniProgram

Introduction

Opens another Mini Program from the current page.

Parameters

Object object

PropertyTypeDefaultRequiredDescription
appIdstringYesThe appId of the Mini Program to open.
pathstringNoThe path to the page to open. If empty, the home page will be opened. The part after "?" in the path will become a query, and you can retrieve query data using dlt.getLaunchOptions in the target Mini Program.
extraDataObjectNoData to be passed to the target Mini Program. The target Mini Program can retrieve this data using dlt.getLaunchOptions.
successfunctionNoCallback function called when the interface is successfully invoked.
failfunctionNoCallback function called when the interface invocation fails.
completefunctionNoCallback function called when the interface invocation is complete (called whether the invocation is successful or not).

object.success Callback Function

Parameters

Object res

PropertyTypeDescription
successstringtrue - Success

object.fail Callback Function

Parameters

Object res

PropertyTypeDescription
successstringfalse - Failure

Sample Code

// pages/index/index.js
Page({
navigateToMiniProgram() {
dlt.navigateToMiniProgram({
appId: 'xxx',
path: 'pages/index/index?a=1',
success: function () {
console.log('success');
},
});
},
});

In the provided sample code, the navigateToMiniProgram function is called to open another Mini Program with the specified appId and path. The success callback logs a message when the operation is successful. Make sure to replace 'xxx' with the actual appId of the target Mini Program and adjust the path as needed.

Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.