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
Name | Type | Mandatory | Description |
key | String | Yes | Cache data key |
Return Value
Name | Type | Description |
data | Object/String | Corresponding content of the key |