localStorage用法

引用:https://www.cnblogs.com/st-leslie/p/5617130.html

const  STORAGE_KEY = 'todos-vuejs';
export default{
fetch(){
return JSON.parse(window.localStorage.getItem(STORAGE_KEY) || '[]');
},
save(items){
window.localStorage.setItem(STORAGE_KEY,JSON.stringify(items));
}
}
上一篇:localStorage 用法


下一篇:localStorage本地存储的用法