随笔分类 -  reactjs随笔

摘要:安装成功后,package.json 这个文件会多出一行 "html-webpack-plugin": "^2.30.1",,如下所示: webpack.config.js 内容大约是下面这样的: 阅读全文
posted @ 2018-03-22 11:21 艾礼富 阅读(112) 评论(0) 推荐(0)
摘要:You may need an appropriate loader to handle this file type. 意思是webpack需要是个插件来出来这个类型的文件! 当安装node-sass处理scss文件的时候,会报错,处理方法是先全局使用sudo npm install -g --u 阅读全文
posted @ 2018-03-19 10:21 艾礼富 阅读(175) 评论(0) 推荐(0)
摘要:面比较一下默认输出和正常输出。 // 第一组export default function crc32() { // 输出 // ...} import crc32 from 'crc32'; // 输入 // 第二组export function crc32() { // 输出 // ...}; 阅读全文
posted @ 2018-01-06 09:29 艾礼富 阅读(208) 评论(0) 推荐(0)
摘要:React.createClass({ propTypes: { // 可以声明 prop 为指定的 JS 基本数据类型,默认情况,这些数据是可选的 optionalArray: React.PropTypes.array, optionalBool: React.PropTypes.bool, o 阅读全文
posted @ 2018-01-05 13:43 艾礼富 阅读(247) 评论(0) 推荐(0)
摘要:<script type="text/babel"> var Hello=React.createClass({ render:function(){ return <span>1</span>; } }); ReactDOM.render(<Hello />, document.getElemen 阅读全文
posted @ 2018-01-04 21:06 艾礼富 阅读(106) 评论(0) 推荐(0)