export default {
data() {
return {};
},created(){
var store=window.localStorage;
store[0]=1;
store[1]=2;
var data={
name:"里斯",
age:"18",
sex:"男"
}
var ss=JSON.stringify(data);
store.setItem('ccc',ss);
console.log(store["ccc"])
}
};
这一篇写得很详细:https://www.cnblogs.com/st-leslie/p/5617130.html