my.getStorageSync
Get cached data synchronously.
This is a synchronous interface.
Sample Code
copy
let res = my.getStorageSync({ key: 'currentCity' });
my.alert({
content: JSON.stringify(res.data),
});
Parameters
Property | Type | Required | Description |
key | String | Yes | Cache data key. |
Return Value
Property | Type | Description |
data | Object/String | Corresponding content of the key. |