Storage
API
/* store data in provided key */
wx.setStorage
/* field of parameter object
* key: string
* data: any
*/
wx.setStorageSync(string key, any data)
/* load data of provided key */
wx.getStorage
/* field of parameter object
* key: string
* parameter of callback on success:
* data: any
*/
wx.getStorageSync(string key) -> any
/* get information of all stored data */
wx.getStorageInfo
/* parameter of callback on success:
* keys: Array.<string> - all keys of stored data
* currentSize: number - current size of all data(KB)
* limitSize: number - bound of size of storage(KB)
*/
wx.getStorageInfoSync -> Object
/* remove data of provided key */
wx.removeStorage
/* field of parameter object
* key: string
*/
wx.removeStorageSync(string key)
/* clear all stored data */
wx.clearStorage
wx.clearStorageSync()Cloud
Reference
Last updated