We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这里使用到的UI库是蚂蚁金服开源的ant-design,为啥使用?我觉得是使用人数比较多,坑比较少吧。
https://github.com/xuya227939/blog/tree/master/examples/react/my-app
$ sudo npm install -g create-react-app //全局安装的话,需要权限,所以使用sudo $ create-react-app my-app $ cd my-app $ npm install antd $ npm start
1.引用官方代码,修改App.js文件,引入ant组件
import React, { Component } from 'react'; import Button from 'antd/lib/button'; import './App.css'; class App extends Component { render() { return ( <div className="App"> <Button type="primary">Button</Button> </div> ); } } export default App;
2.引用官方代码,修改App.css
@import '~antd/dist/antd.css'; .App { text-align: center; } .App-logo { animation: App-logo-spin infinite 20s linear; height: 80px; } .App-header { background-color: #222; height: 150px; padding: 20px; color: white; } .App-title { font-size: 1.5em; } .App-intro { font-size: large; } @keyframes App-logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
你就可以看到蓝色的按钮了。
1.如果报类似这样的错,react-scripts command not found 那么就 $ rm -rf node_modules 模块,重新安装下 $ npm i,再重新npm start
react入门,首先从搭建react开始。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
介绍
这里使用到的UI库是蚂蚁金服开源的ant-design,为啥使用?我觉得是使用人数比较多,坑比较少吧。
例子
https://github.com/xuya227939/blog/tree/master/examples/react/my-app
安装
使用
1.引用官方代码,修改App.js文件,引入ant组件
2.引用官方代码,修改App.css
你就可以看到蓝色的按钮了。
问题处理
1.如果报类似这样的错,react-scripts command not found 那么就 $ rm -rf node_modules 模块,重新安装下 $ npm i,再重新npm start
结语
react入门,首先从搭建react开始。
The text was updated successfully, but these errors were encountered: