update readme

This commit is contained in:
yiminghe 2016-04-28 12:41:37 +08:00
parent d40fd90176
commit 12a7c32643
2 changed files with 21 additions and 3 deletions

View File

@ -22,6 +22,8 @@ npm install antd
## Usage example
### Use prebuilt bundle
```jsx
import { DatePicker } from 'antd';
ReactDOM.render(<DatePicker />, mountNode);
@ -30,11 +32,27 @@ ReactDOM.render(<DatePicker />, mountNode);
Import style:
```jsx
import 'antd/lib/index.css'; // or 'antd/style/index.less'
import 'antd/dist/antd.css'; // or 'antd/style/index.less'
```
Use components on demand by writing as `import DatePicker from 'antd/lib/date-picker'` or use [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd).
### Use modularized antd
use [babel-plugin-antd](https://github.com/ant-design/babel-plugin-antd).
babel plugin config:
```
['antd', {
style: 'css'
}]
```
```jsx
import { DatePicker } from 'antd';
ReactDOM.render(<DatePicker />, mountNode);
```
No need to import style manually.
## Browser Support

View File

@ -123,7 +123,7 @@
"eslint-fix": "eslint --fix components test site scripts ./*.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md",
"test": "npm run lint && npm run dist && npm run jest",
"jest": "jest",
"prepub":"node ./scripts/prepub",
"pre-pub":"node ./scripts/prepub",
"pub": "antd-tools run pub",
"beta": "antd-tools run beta",
"authors": "git log --format='%aN <%aE>' | sort -u | grep -v 'users.noreply.github.com' | grep -v 'alibaba-inc.com' | grep -v 'alipay.com' | grep -v 'taobao.com' > AUTHORS.txt"