//存储
AsyncStorage.setItem('user',JSON.stringify(object));
//读取
AsyncStorage.getItem('user').then((value)=>{
let user = JSON.parse(value);
this.userId = user.userId;
this.userName = user.username;
});
//存储
AsyncStorage.setItem('user',JSON.stringify(object));
//读取
AsyncStorage.getItem('user').then((value)=>{
let user = JSON.parse(value);
this.userId = user.userId;
this.userName = user.username;
});
本文标题:react native 存储和读取json并转换为对象
本文链接:https://www.haomeiwen.com/subject/tblysftx.html
网友评论