diff --git a/README-zh_CN.md b/README-zh_CN.md index d75a2351d9..4539b04e7e 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -40,7 +40,7 @@ ## 安装 ```bash -npm install antd +npm install antd --save ``` ## 示例 @@ -56,7 +56,7 @@ ReactDOM.render(, mountNode); import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ``` -按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用 Babel 插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import),或使用 TypeScript 插件 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin)。 +你也可以[按需加载组件](https://ant.design/docs/react/getting-started-cn#按需加载)。 ## TypeScript diff --git a/README.md b/README.md index 16693aaa25..cb41d0e2d4 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ An enterprise-class UI design language and React-based implementation. ## Install ```bash -npm install antd +npm install antd --save ``` ## Usage @@ -56,33 +56,7 @@ And import style manually: import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ``` -### Use modularized antd - -- Manually import - - ```jsx - import DatePicker from 'antd/lib/date-picker'; // for js - import 'antd/lib/date-picker/style/css'; // for css - // import 'antd/lib/date-picker/style'; // that will import less - ``` - -- Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) - - ```js - // .babelrc or babel-loader option - { - "plugins": [ - ["import", { "libraryName": "antd", "style": "css" }] // `style: true` for less - ] - } - ``` - - Then you can import components from antd, equivalent to import manually below. - - ```jsx - // import js and css modularly, parsed by babel-plugin-import - import { DatePicker } from 'antd'; - ``` +Or [import components on demand](https://ant.design/docs/react/getting-started#Import-on-Demand) ### TypeScript