update import document

This commit is contained in:
afc163 2015-12-16 15:04:51 +08:00
parent 269326abaa
commit 4bb18780e5
3 changed files with 16 additions and 51 deletions

View File

@ -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)。
## 浏览器支持

View File

@ -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

View File

@ -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';
```
## 版本