# any wx.getStorageSync(string key)
with Promise style call: Supported
Mini Program plugin: Support, need to Mini Program base library version no less than 1.9.6
wx.getStorage The synchronous version of
# parameter
# string key
Specified in the local cache key
# Return value
# any data
Key corresponds to the content
# sample code
wx.getStorage({
key: 'key',
success (res) {
console.log(res.data)
}
})
try {
where value = wx.getStorageSync('key')
if (value) {
// From the something with return value
}
} catch (and) {
// From the something when catch error
}