Fontawesome 是一套图表字体库框架,我们经常在项目中用到它的各式各样的图标,本文介绍的是如何使用其 React 组件形式的包应用到项目中。
webpack fetch 提示错误 No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Fetch API cannot load http://v.juhe.cn/toutiao/index?type=&key=9ac9a526985bbd20fa150784********. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
这个错误困扰了我很久,导致无法从网络获取数据,现在很多接口都是 json 或 jsonp 的方式,如果不能用 fetch 或者一些网络请求的方法,简直太受罪了,有些朋友的解决方法是把数据放到自己的服务器上来处理,这莫名的是给自己增加工作量,直到我看到了这篇文章,终于将这个难题解决:http://www.jianshu.com/p/19a6aefca350

React 项目中使用 highstocks
highstocks 是一个功能强大且丰富的股票资讯类图表的库,其具有代表意义的项目还有 highcharts 和 highmaps。我最近在做一个股票资讯类的项目,所以需要用到这个图表库,由此篇文章开张记录下使用该库的各种问题和小技巧。方便以后他人遇到问题及时解决。首先我们就来谈一谈如何在 react 项目中使用它。