mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
update import document
This commit is contained in:
parent
269326abaa
commit
4bb18780e5
@ -23,31 +23,19 @@ npm install antd
|
||||
|
||||
## 示例
|
||||
|
||||
- 使用全部组件
|
||||
|
||||
```jsx
|
||||
import { DatePicker } from 'antd';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
|
||||
- 按需使用
|
||||
|
||||
```jsx
|
||||
import DatePicker from 'antd/lib/date-picker';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
```jsx
|
||||
import { DatePicker } from 'antd';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
|
||||
引入样式:
|
||||
|
||||
```jsx
|
||||
// only need to import once in entry module
|
||||
import 'antd/lib/index.css';
|
||||
import 'antd/lib/index.css'; // or 'antd/style/index.less'
|
||||
```
|
||||
|
||||
```jsx
|
||||
// or less for modifyVars
|
||||
import 'antd/style/index.less';
|
||||
```
|
||||
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker';` 或使用插件 [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd)。
|
||||
|
||||
|
||||
## 浏览器支持
|
||||
|
||||
|
26
README.md
26
README.md
@ -22,31 +22,19 @@ npm install antd
|
||||
|
||||
## Usage example
|
||||
|
||||
- Use all components
|
||||
|
||||
```jsx
|
||||
import { DatePicker } from 'antd';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
|
||||
- Use on demand
|
||||
|
||||
```jsx
|
||||
import DatePicker from 'antd/lib/date-picker';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
```jsx
|
||||
import { DatePicker } from 'antd';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
|
||||
Import style:
|
||||
|
||||
```jsx
|
||||
// only need to import once in entry module
|
||||
import 'antd/lib/index.css';
|
||||
import 'antd/lib/index.css'; // or 'antd/style/index.less'
|
||||
```
|
||||
|
||||
```jsx
|
||||
// or less for modifyVars
|
||||
import 'antd/style/index.less';
|
||||
```
|
||||
Use antd on demand by `import DatePicker from 'antd/lib/date-picker';` or use [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd).
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
|
@ -39,25 +39,14 @@ import { DatePicker } from 'antd';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
|
||||
或者按需加载:
|
||||
|
||||
```jsx
|
||||
import DatePicker from 'antd/lib/date-picker';
|
||||
ReactDOM.render(<DatePicker />, mountNode);
|
||||
```
|
||||
|
||||
引入样式:
|
||||
|
||||
```jsx
|
||||
import 'antd/lib/index.css'; // 样式需要在入口处引用一次
|
||||
import 'antd/lib/index.css'; // or 'antd/style/index.less'
|
||||
```
|
||||
|
||||
或者引入 less 文件,可用于主题配置:
|
||||
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker';` 或使用插件 [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd)。
|
||||
|
||||
```jsx
|
||||
// or less for modifyVars
|
||||
import 'antd/style/index.less';
|
||||
```
|
||||
|
||||
## 版本
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user