-
Notifications
You must be signed in to change notification settings - Fork 0
memory.js
Carl's edited this page May 27, 2021
·
4 revisions
setItem{
zh:"你好",
key:"nihao"
})
- test
getItem("nihao")
- return
{
zh:"你好",
order:0
key:"nihao"
}
localStorage.clear();
setItem{
zh:"你好",
key:"nihao"
});
setItem{
zh:"你好",
key:"nihao"
});
- test
getItem("nihao")
- return
{
zh:"你好",
order:2
key:"nihao"
}
localStorage.clear();
setItem{
zh:"你好",
key:"nihao"
});
try{
let t= localStorage.getItem("vue-keyboard-cn-store");
let parseJons=JSON.parse(t);
parseJons["__$lastClearTime"]=new Date().getTime()-(86400*7);
let stringStore=JSON.string(parseJons["__$lastClearTime"]);
localStorage.setItem("vue-keyboard-cn-store",stringStore);
}catch(e){}
setItem{
zh:"哈喽",
key:"halou"
});
- test
getItem("nihao")
- return
{}
happy,ending!!