React-Native中AsyncStorage的用法
2017-07-25 11:32
507 查看
//首先引入AsyncStorage import {AsyncStorage} from 'react-native'; class Test{ //获取 static get(key){ return AsyncStorage.getItem(key).then((value) => { 14 const jsonValue = JSON.parse(value); 15 return jsonValue; 16 }); } //saveItem保存,setItem储存(写),getItem(得到,读) export default Test; //AsyncStorage中,值可以直接储存,对象要json解析成字符串或者键值对存入
相关文章推荐
- React-Native学习笔记之:AsyncStorage数据存取操作
- react-native 使用AsyncStorage实现长登陆
- React-native 之 AsyncStorage学习
- 《React-Native系列》28、 RN之AsyncStorage
- React Native之AsyncStorage
- Promise and AsyncStorage React Native
- react-native之AsyncStorage
- React-Native AsyncStorage setNativeProps
- react-native AsyncStorage 数据持久化方案
- React Native——AsyncStorage
- React Native AsyncStorage本地存储工具类
- react native AsyncStorage
- react-native-image-picker上传头像 + modal浮层 +AsyncStorage.setItem-getItem
- 《React-Native系列》28、 RN之AsyncStorage
- react native AsyncStorage 使用详解
- ReactNative (API)AsyncStorage存储详解及实例
- react-native-AsyncStorage<持久化数据存储>
- React-Native AsyncStorage setNativeProps
- react-native中AsyncStorage实例详解
- React-Native AsyncStorage使用