setStorage
//设置本地存储
uni.setStorage({
// 保存为本地存储
key:'add-input',
// 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象
data:JSON.stringify({
content:this.content,
imageList:this.imageList
})
})
getStorage
//获取本地存储
uni.getStorage({
key:'add-input',
// 通过success函数得到返回数据
success: (res) => {
console.log(res)
}
})
removeStorage
// 清空本地存储信息
uni.removeStorage({
key:'add-input'//要清楚信息的key
})