mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
Update README.md
This commit is contained in:
parent
1b9513e0eb
commit
c65a736714
33
README.md
33
README.md
@ -37,25 +37,28 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
|||||||
|
|
||||||
### Use modularized antd
|
### Use modularized antd
|
||||||
|
|
||||||
```jsx
|
- Use [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd) (Recommended)
|
||||||
import DatePicker from 'antd/lib/date-picker'; // just for js
|
|
||||||
```
|
|
||||||
|
|
||||||
Or we recommend use [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd) with config:
|
```js
|
||||||
|
// .babelrc
|
||||||
|
{
|
||||||
|
"plugins": [["antd", { style: "css" }]]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
```js
|
Then you can import components from antd directly.
|
||||||
// .babelrc
|
|
||||||
{
|
|
||||||
"plugins": [["antd", { style: "css" }]]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Then you can import antd modularly and simply:
|
```jsx
|
||||||
|
// import js and css modularly, parsed by babel-plugin-antd
|
||||||
|
import { DatePicker } from 'antd';
|
||||||
|
```
|
||||||
|
|
||||||
|
- Manually import
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
import DatePicker from 'antd/lib/date-picker'; // just for js
|
||||||
|
```
|
||||||
|
|
||||||
```jsx
|
|
||||||
// import js and css modularly
|
|
||||||
import { DatePicker } from 'antd';
|
|
||||||
```
|
|
||||||
|
|
||||||
## Browser Support
|
## Browser Support
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user