
React
文章平均质量分 66
闲逛上海滩
闲逛上海滩
展开
-
babel - 使用Webpack和Babel来搭建React应用程序
用Webpack(npm install -g webpack)代码打包,Webpack大致需要知道三件事:1)让Webpack知道应用程序或js文件的根目录2)让Webpack知道做何种转换3)让Webpack知道转换后的文件保存在哪里具体来说,大致要做以下几件事情:1)在项目根目录下有一个webpack.config.js文件转载 2016-12-18 22:15:08 · 1588 阅读 · 0 评论 -
前端框架React - 渲染元素
1.把元素渲染进DOMTo render a React element into a root DOM node, pass both to ReactDOM.render()为了把一个react元素渲染进DOM,把他们两个都传进ReactDOM.render()方法。const element = Hello, world;ReactDOM.render(原创 2017-03-25 21:46:52 · 769 阅读 · 0 评论 -
前端框架React - Components and Props
1.Functional and Class ComponentsThey accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen.控件可以接受任意输入(叫做props),返回要显示在screen上的React原创 2017-03-26 01:15:39 · 751 阅读 · 0 评论 -
前端框架React - State 和 生命周期
1.Introduction of statethe fact that the Clock sets up a timer and updates the UI every second should be an implementation detail of the Clock.事实上组件的功能和更新UI的代码应该是组件自己的具体实现细节。ReactDOM原创 2017-03-26 23:25:56 · 1224 阅读 · 0 评论 -
VScode格式化代码插件beautify
vscode编辑器格式化react代码插件beautify和react-beautify插件bea命令按下F1,然后输入bea由于我们要格式化JSX代码,所以我们选择第二个选项,然后我们就会发现代码被格式化了。原创 2017-07-27 15:54:59 · 51299 阅读 · 2 评论