序列化处理
结果:
wx.removeStorageSync('ManuPageList'+key); 动态添加id
###
tStorageSync 存储对象ManuPageList
wx.setStorageSync('ManuPageList'+key, {
id:this.data.id,
videoPath: this.data.src,
imgPath: this.data.imgList,
ManuContent: this.data.ManuContent,
Manutitle: this.data.Manutitle,
})
### getStorageSync获取对象ManuPageList
let ManuPageListT= wx.getStorageSync('ManuPageList')
console.log(ManuPageListT)
if(ManuPageListT.id=options.id){
this.setData({
src:ManuPageListT.videoPath,
imgList:ManuPageListT.imgPath,
ManuContent:ManuPageListT.ManuContent,
Manutitle:ManuPageListT.Manutitle,
})
}
调用该对象this.clearStorage
### getStorageSync 删除对象ManuPageList
clearStorage(){
wx.removeStorageSync('ManuPageList');
wx.removeStorageSync('imgPath');
wx.removeStorageSync('ManuContent');
wx.removeStorageSync('Manutitle');
},