Browse Source

Revise docs (#8368)

pull/8372/head
Wei Zhu 7 years ago
committed by GitHub
parent
commit
16b69312db
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      README-zh_CN.md
  2. 16
      README.md
  3. 4
      docs/react/getting-started.en-US.md
  4. 6
      docs/react/getting-started.zh-CN.md
  5. 23
      docs/react/i18n.en-US.md
  6. 29
      docs/react/i18n.zh-CN.md
  7. 8
      docs/react/introduce.en-US.md
  8. 12
      docs/react/introduce.zh-CN.md
  9. 2
      docs/react/practical-projects.en-US.md
  10. 4
      docs/react/practical-projects.zh-CN.md
  11. 2
      docs/react/recommendation.en-US.md
  12. 2
      docs/react/recommendation.zh-CN.md
  13. 4
      docs/react/use-in-typescript.en-US.md
  14. 4
      docs/react/use-in-typescript.zh-CN.md
  15. 2
      docs/react/use-with-create-react-app.en-US.md
  16. 2
      docs/react/use-with-create-react-app.zh-CN.md

6
README-zh_CN.md

@ -60,11 +60,11 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
## TypeScript
- 不要使用 @types/antd, antd 已经自带了 TypeScript 定义。
参考 [在 TypeScript 中使用](https://ant.design/docs/react/use-in-typescript-cn)
## 国际化
参考 [国际化文档](http://ant.design/docs/react/i18n)。
参考 [国际化文档](http://ant.design/docs/react/i18n-cn)。
## 链接
@ -80,7 +80,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [开发者说明](https://github.com/ant-design/ant-design/wiki/Development)
- [版本发布规则](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)
- [常见问题](https://github.com/ant-design/ant-design/wiki/FAQ)
- [CodePen 模板](http://codepen.io/benjycui/pen/KgPZrE?editors=001) for bug reports
- [CodeSandbox 模板](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [定制主题](http://ant.design/docs/react/customize-theme-cn)

16
README.md

@ -86,20 +86,8 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
### TypeScript
- Don't use @types/antd, antd provide a built-in ts definition already.
See [Use in TypeScript](https://ant.design/docs/react/use-in-typescript)
#### Use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) with modularized antd
```js
{
loader: "ts-loader", // or awesome-typescript-loader
options {
getCustomTransformers: () => ({
before: [ tsImportPluginFactory({ libraryName: "antd", style: "css" }) ]
})
}
}
```
## Internationalization
@ -118,7 +106,7 @@ See [i18n](http://ant.design/docs/react/i18n).
- [Developer Instruction](https://github.com/ant-design/ant-design/wiki/Development)
- [Versioning Release Note](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)
- [FAQ](https://github.com/ant-design/ant-design/wiki/FAQ)
- [CodePen boilerplate](http://codepen.io/benjycui/pen/KgPZrE?editors=001) for bug reports
- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [Customize Theme](http://ant.design/docs/react/customize-theme)

4
docs/react/getting-started.en-US.md

@ -11,9 +11,9 @@ Before delving into Ant Design React, a good knowledge of [React](http://faceboo
## First Example
The following CodePen demo is the simplest use case, and it's also a good habit to fork this demo to provide a re-producible demo while reporting a bug. Please don't use this demo as a scaffold in production.
The following CodeSandbox demo is the simplest use case, and it's also a good habit to fork this demo to provide a re-producible demo while reporting a bug. Please don't use this demo as a scaffold in production.
- [antd CodePen](http://codepen.io/anon/pen/wGOWGW?editors=001)
- [antd CodeSandbox](https://u.ant.design/codesandbox-repro)
## Standard Development Flow

6
docs/react/getting-started.zh-CN.md

@ -11,9 +11,9 @@ Ant Design React 致力于提供给程序员**愉悦**的开发体验。
## 第一个例子
最简单的使用方式参照以下 CodePen 演示,也推荐 Fork 本例来进行 `Bug Report`,注意不要在实际项目中这样使用。
最简单的使用方式参照以下 CodeSandbox 演示,也推荐 Fork 本例来进行 `Bug Report`,注意不要在实际项目中这样使用。
- [antd CodePen](http://codepen.io/benjycui/pen/KgPZrE?editors=001)
- [antd CodeSandbox](https://u.ant.design/codesandbox-repro)
## 标准开发
@ -198,7 +198,7 @@ import { Button } from 'antd';
- [改变主题](/docs/react/customize-theme)
- [使用本地字体](https://github.com/ant-design/antd-init/tree/master/examples/local-iconfont)
## 小甜点
## 小贴士
- 你可以享用 `npm` 生态圈里的所有模块。
- 我们使用了 `babel`,试试用 [ES2015](http://babeljs.io/blog/2015/06/07/react-on-es6-plus) 的写法来提升编码的愉悦感。

23
docs/react/i18n.en-US.md

@ -30,36 +30,37 @@ Supported languages:
|Arabic|ar_EG|
|Bulgarian|bg_BG|
|Catalan|ca_ES|
|Chinese (Traditional)|zh_TW|
|Chinese (Simplified)|zh_CN|
|Czech|cs_CZ|
|Dutch (Belgium)|nl_BE|
|Dutch|nl_NL|
|German|de_DE|
|Greek|el_GR|
|English (Global)|en_GB|
|English|en_US|
|Spanish|es_ES|
|Estonian|et_EE|
|Persian|fa_IR|
|Finnish|fi_FI|
|French (Belgium)|fr_BE|
|French (France)|fr_FR|
|German|de_DE|
|Greek|el_GR|
|Icelandic|is_IS|
|Italian|it_IT|
|Icelandic|is_IS|
|Japanese|ja_JP|
|Korean|ko_KR|
|Norwegian|nb_NO|
|Persian|fa_IR|
|Dutch (Belgium)|nl_BE|
|Dutch|nl_NL|
|Polish|pl_PL|
|Portuguese (Brazil)|pt_BR|
|Portuguese|pt_PT|
|Russian|ru_RU|
|Serbian|sr_RS|
|Slovak|sk_SK|
|Spanish|es_ES|
|Serbian|sr_RS|
|Swedish|sv_SE|
|Thai|th_TH|
|Turkish|tr_TR|
|Russian|ru_RU|
|Ukrainian|uk_UA|
|Vietnamese|vi_VN|
|Chinese (Simplified)|zh_CN|
|Chinese (Traditional)|zh_TW|
See usage and ways to contribute a new locale package at [LocaleProvider](/components/locale-provider).

29
docs/react/i18n.zh-CN.md

@ -28,34 +28,37 @@ return (
|阿拉伯|ar_EG|
|保加利亚语|bg_BG|
|加泰罗尼亚语|ca_ES|
|繁体中文|zh_TW|
|简体中文|zh_CN|
|捷克语|cs_CZ|
|比利时荷兰语|nl_BE|
|荷兰语|nl_NL|
|德语|de_DE|
|希腊语|el_GR|
|英语|en_GB|
|美式英语|en_US|
|英语(美式)|en_US|
|西班牙语|es_ES|
|爱沙尼亚语|et_EE|
|波斯语|fa_IR|
|芬兰语|fi_FI|
|比利时法语|fr_BE|
|法语(比利时)|fr_BE|
|法语|fr_FR|
|德语|de_DE|
|希腊语|el_GR|
|冰岛语|is_IS|
|意大利语|it_IT|
|日语|ja_JP|
|韩语/朝鲜语|ko_KR|
|挪威|nb_NO|
|波斯语|fa_IR|
|荷兰语(比利时)|nl_BE|
|荷兰语|nl_NL|
|波兰语|pl_PL|
|葡萄牙语|pt_BR|
|俄罗斯语|ru_RU|
|塞尔维亚|sr_RS|
|葡萄牙语(巴西)|pt_BR|
|葡萄牙语|pt_PT|
|斯洛伐克语|sk_SK|
|西班牙语|es_ES|
|塞尔维亚|sr_RS|
|瑞典语|sv_SE|
|泰语|th_TH|
|土耳其语|tr_TR|
|俄罗斯语|ru_RU|
|乌克兰语|uk_UA|
|越南语|vi_VN|
|简体中文|zh_CN|
|繁体中文|zh_TW|
具体的使用方法和新语言包贡献方式请参考 [LocaleProvider 文档](/components/locale-provider)。

8
docs/react/introduce.en-US.md

@ -90,11 +90,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "antd", "style": "css" }] // `style: true` for less
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }] // `style: true` for less
]
}
```
> Note: Don't set `libraryDirectory` if you are using webpack 1.
This allows you to import components from antd without having to manually import the corresponding stylesheet. The antd babel plugin will automatically import stylesheets.
```jsx
@ -127,13 +129,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [Developer Instruction](https://github.com/ant-design/ant-design/wiki/Development)
- [Versioning Release Note](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)
- [FAQ](https://github.com/ant-design/ant-design/wiki/FAQ)
- [CodePen boilerplate](http://codepen.io/benjycui/pen/KgPZrE?editors=001) for bug reports
- [CodeSandbox template](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [Customize Theme](/docs/react/customize-theme)
## Companies using antd
- [Ant Financial](http://www.antgroup.com/index.htm?locale=en_US)
- [Ant Financial](http://www.antfin.com/index.htm?locale=en_US)
- [Alibaba](http://www.alibaba.com/)
- [Tencent](http://www.tencent.com)
- [Baidu](http://www.baidu.com)

12
docs/react/introduce.zh-CN.md

@ -93,11 +93,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "antd", "style": "css" }] // `style: true` 会加载 less 文件
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }] // `style: true` 会加载 less 文件
]
}
```
> 注意:webpack 1 无需设置 `libraryDirectory`
然后只需从 antd 引入模块即可,无需单独引入样式。等同于下面手动引入的方式。
```jsx
@ -113,10 +115,6 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
// import 'antd/lib/date-picker/style'; // 加载 LESS
```
### TypeScript
- 不要使用 @types/antd, antd 已经自带了 TypeScript 定义。
## 链接
- [首页](http://ant.design/)
@ -131,13 +129,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [开发者说明](https://github.com/ant-design/ant-design/wiki/Development)
- [版本发布规则](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)
- [常见问题](https://github.com/ant-design/ant-design/wiki/FAQ)
- [CodePen 模板](http://codepen.io/benjycui/pen/KgPZrE?editors=001) for bug reports
- [CodeSandbox 模板](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [定制主题](/docs/react/customize-theme)
## 谁在使用
- [蚂蚁金服](http://www.antgroup.com/)
- [蚂蚁金服](http://www.antfin.com/)
- [阿里巴巴](http://www.alibaba.com/)
- [腾讯](http://www.tencent.com)
- [百度](http://www.baidu.com)

2
docs/react/practical-projects.en-US.md

@ -67,7 +67,7 @@ Edit `.roadhogrc` to integrate `babel-plugin-import`.
"extraBabelPlugins": [
- "transform-runtime"
+ "transform-runtime",
+ ["import", { "libraryName": "antd", "style": "css" }]
+ ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }]
],
```

4
docs/react/practical-projects.zh-CN.md

@ -18,7 +18,7 @@ title: 项目实战
```bash
$ npm install dva-cli -g
$ dva -v
0.8.1
0.8.2
```
## 创建新应用
@ -67,7 +67,7 @@ $ npm install antd babel-plugin-import --save
"extraBabelPlugins": [
- "transform-runtime"
+ "transform-runtime",
+ ["import", { "libraryName": "antd", "style": "css" }]
+ ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }]
],
```

2
docs/react/recommendation.en-US.md

@ -18,7 +18,7 @@ Copy to clipboard | [react-copy-to-clipboard](https://github.com/nkbt/react-copy
Document head manager | [react-helmet](https://github.com/nfl/react-helmet) [react-document-title](https://github.com/gaearon/react-document-title)
Icons | [react-fa](https://github.com/andreypopp/react-fa) [react-icons](https://github.com/gorangajic/react-icons)
QR Code | [qrcode.react](https://github.com/zpao/qrcode.react)
Charts | [g2-react](https://github.com/antvis/g2-react) [recharts](https://github.com/recharts/recharts/) [victory](https://github.com/FormidableLabs/victory)
Charts | [BizCharts](https://github.com/alibaba/BizCharts) [recharts](https://github.com/recharts/recharts/) [victory](https://github.com/FormidableLabs/victory)
Top Progress Bar | [nprogress](https://github.com/rstacruz/nprogress)
i18n | [react-intl](https://github.com/yahoo/react-intl)
Code highlight | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter)

2
docs/react/recommendation.zh-CN.md

@ -18,7 +18,7 @@ title: 社区精选组件
页面 meta 属性 | [react-helmet](https://github.com/nfl/react-helmet) [react-document-title](https://github.com/gaearon/react-document-title)
图标 | [react-fa](https://github.com/andreypopp/react-fa) [react-icons](https://github.com/gorangajic/react-icons)
二维码 | [qrcode.react](https://github.com/zpao/qrcode.react)
可视化图表 | [g2-react](https://github.com/antvis/g2-react) [recharts](https://github.com/recharts/recharts/) [victory](https://github.com/FormidableLabs/victory)
可视化图表 | [BizCharts](https://github.com/alibaba/BizCharts) [recharts](https://github.com/recharts/recharts/) [victory](https://github.com/FormidableLabs/victory)
顶部进度条 | [nprogress](https://github.com/rstacruz/nprogress)
应用国际化 | [react-intl](https://github.com/yahoo/react-intl)
代码高亮 | [react-syntax-highlighter](https://github.com/conorhastings/react-syntax-highlighter)

4
docs/react/use-in-typescript.en-US.md

@ -215,10 +215,6 @@ You can also follow instructions in [Use in create-react-app](/docs/react/use-wi
## FAQ
### error TS7006: Parameter 'x' implicitly has an 'any' type.
You need setting `skipLibCheck` to `true` in tsconfig.json.
### error TS2605: JSX element type Xxx is not a constructor function for JSX elements.
Before antd 3, You need setting `allowSyntheticDefaultImports` to `true` in tsconfig.json.

4
docs/react/use-in-typescript.zh-CN.md

@ -217,10 +217,6 @@ $ yarn add react-app-rewire-less --dev
## 常见问题
### error TS7006: Parameter 'x' implicitly has an 'any' type.
需要在 tsconfig.json 的 `compilerOptions` 中配置 `"skipLibCheck": true`
### error TS2605: JSX element type Xxx is not a constructor function for JSX elements.
antd 3 以前的版本需要在 tsconfig.json 的 `compilerOptions` 中配置 `"allowSyntheticDefaultImports": true`

2
docs/react/use-with-create-react-app.en-US.md

@ -140,7 +140,7 @@ $ yarn add babel-plugin-import --dev
+ const { injectBabelPlugin } = require('react-app-rewired');
module.exports = function override(config, env) {
+ config = injectBabelPlugin(['import', { libraryName: 'antd', style: 'css' }], config);
+ config = injectBabelPlugin(['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }], config);
return config;
};
```

2
docs/react/use-with-create-react-app.zh-CN.md

@ -137,7 +137,7 @@ $ yarn add babel-plugin-import --dev
+ const { injectBabelPlugin } = require('react-app-rewired');
module.exports = function override(config, env) {
+ config = injectBabelPlugin(['import', { libraryName: 'antd', style: 'css' }], config);
+ config = injectBabelPlugin(['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }], config);
return config;
};
```

Loading…
Cancel
Save