在react项目中引入antd
一、antd官网地址
https://ant.design/docs/react/introduce
二、引进antd(直接引入)
1、安装antd
npm install antd --save / yarn add antd / cnpm install antd --save
2、在react项目的APP.js文件中引入 Antd的css(全局)
@import 'antd/dist/antd.css';
3、看文档使用:
如使用Button:
1、在对应的组件中引入Antd
import { Button } from 'antd';
2、在对应的页面引用
<Button type="primary">Primary</Button>
3、效果
三、引进antd(React中使用Antd高级配置,按需引入css样式)
需要安装babel-plugin-import、react-app-rewired配合实现样式的按需加载(之后再进一步更新)
https://www.cnblogs.com/chengyunshen/p/10366110.html