下载源代码:
git clone https://github.com/MarshalW/news-demo.git
下载依赖库:
npm install
react和react transform boilerplate最简单的集成。
切换版本:
git checkout helloworld
然后:
npm start
再浏览器打开:http://localhost:3000/
切换版本:
git checkout sync_news_list
然后:
npm start
再浏览器打开:http://localhost:3000/
新闻数据通过ajax获取(news.json)。为了模拟网络加载慢情况下loading效果,使用Promise做了一个延时。
切换版本:
git checkout async_news_list
然后:
npm start
再浏览器打开:http://localhost:3000/