HomeDocs
Skip to main content

dlt.getStorage

Introduction​

Asynchronously retrieves the value of the specified key from the local cache.

Parameters​

Object object

PropertyTypeDefaultRequiredDescription
keystringYesThe key of the value to retrieve from the local cache.
successfunctionNoCallback function for a successful API call.
failfunctionNoCallback function for a failed API call.
completefunctionNoCallback function that will be executed when the API call is complete (both successful and failed calls).

success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringtrue - successful
datastringThe stored data

fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringfalse - failed

Example Code​

// pages/index/index.js
Page({
getStorage() {
dlt.getStorage({
key: "xxx",
success:function(data){
console.log("get data": data)
}
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.