forked from crazycodeboy/RNStudyNotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0fa70a
commit 83ca9bd
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# Learn a little every day | ||
|
||
|
||
``` | ||
模板 | ||
``` | ||
|
||
|
||
|
||
D1:React Native 读取本地的json文件 (2016-8-18) | ||
------ | ||
自 React Native 0.4.3,你可以导入的形式,来读取本地的json文件,导入的文件可以作为一个js对象使用。 | ||
|
||
### 第一步:导入json文件 | ||
|
||
```JavaScript | ||
var customData = require('./customData.json'); | ||
``` | ||
|
||
ES6/ES2015 | ||
|
||
```JavaScript | ||
import customData from './customData.json'; | ||
``` | ||
|
||
### 第二步:使用 | ||
|
||
|
||
|
||
@[How to fetch data from local JSON file on react native?](http://stackoverflow.com/questions/29452822/how-to-fetch-data-from-local-json-file-on-react-native) |