HomeDocs
Skip to main content

dlt.loadSubPackage

Introduction​

Download subpackage resources.

Usage Restrictions​

Supported from Core Library version 7.2.0 and above.

Parameters​

Object object

PropertyTypeDefaultRequiredDescription
rootStringYesThe root of the subpackage that needs to be downloaded
successFunctionNoCallback function for a successful API call
failFunctionNoCallback function for a failed API call
completeFunctionNoCallback function executed at the end of the API call (executed for both success and failure)

object.success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringtrue - Success

object.fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringfalse - Failure

Example Code​

// pages/index/index.js
Page({
loadSubPackage() {
dlt.loadSubPackage({
root: 'packageA',
success: res => {
console.log('loadSubPackage success', res);
},
fail: err => {
console.log('loadSubPackage fail', err);
},
complete: res => {
console.log('loadSubPackage complete', res);
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.