-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ConfigProvider): add icons config
- Loading branch information
Showing
45 changed files
with
452 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,36 @@ | ||
# ConfigProvider | ||
|
||
Configure locale messages and custom icons globally. | ||
|
||
## When to use | ||
|
||
- You want to use other languages than English | ||
- You want to use your own icon set instead of `antd-mobile-icons` | ||
|
||
## Demos | ||
|
||
<code src="./demos/demo1.tsx" ></code> | ||
|
||
<code src="./demos/demo2.tsx" ></code> | ||
|
||
## ConfigProvider | ||
|
||
### Props | ||
|
||
| Name | Description | Type | Default | | ||
| --- | --- | --- | --- | | ||
| locale | Locale messages | `Locale` | [zh-CN] | | ||
| checkList | CheckList config | `{ activeIcon?: ReactNode }` | - | | ||
| collapse | Collapse config | `{ arrowIcon?: ReactNode \| ((active: boolean) => ReactNode) }` | - | | ||
| dropdown | Dropdown config | `{ arrowIcon?: ReactNode }` | - | | ||
| form | Form config | `{ helpIcon?: ReactNode }` | - | | ||
| input | Input config | `{ clearIcon?: ReactNode }` | - | | ||
| list | List config | `{ arrowIcon?: ReactNode }` | - | | ||
| navBar | NavBar config | `{ backIcon?: ReactNode }` | - | | ||
| noticeBar | NoticeBar config | `{ icon?: ReactNode, closeIcon?: ReactNode }` | - | | ||
| popup | Popup config | `{ closeIcon?: ReactNode }` | - | | ||
| result | Result config | `{ successIcon?: ReactNode, errorIcon?: ReactNode, infoIcon?: ReactNode, waitingIcon?: ReactNode, warningIcon?: ReactNode }` | - | | ||
| searchBar | SearchBar config | `{ icon?: ReactNode }` | - | | ||
| toast | Toast config | `{ successIcon?: ReactNode, failIcon?: ReactNode, loadingIcon?: ReactNode }` | - | | ||
|
||
[zh-CN]: https://github.com/ant-design/ant-design-mobile/blob/master/src/locales/zh-CN.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,36 @@ | ||
# ConfigProvider 配置 | ||
|
||
用于全局配置本地化文案和个性化图标。 | ||
|
||
## 何时使用 | ||
|
||
- 您想使用除英文之外的语言。 | ||
- 您想使用自己的图标集,而不是内置的 `antd-mobile-icons`。 | ||
|
||
## 示例 | ||
|
||
<code src="./demos/demo1.tsx" ></code> | ||
|
||
<code src="./demos/demo2.tsx" ></code> | ||
|
||
## ConfigProvider | ||
|
||
### 属性 | ||
|
||
| 属性 | 说明 | 类型 | 默认值 | | ||
| --- | --- | --- | --- | | ||
| locale | 本地化文案 | `Locale` | [zh-CN] | | ||
| checkList | CheckList 配置 | `{ activeIcon?: ReactNode }` | - | | ||
| collapse | Collapse 配置 | `{ arrowIcon?: ReactNode \| ((active: boolean) => ReactNode) }` | - | | ||
| dropdown | Dropdown 配置 | `{ arrowIcon?: ReactNode }` | - | | ||
| form | Form 配置 | `{ helpIcon?: ReactNode }` | - | | ||
| input | Input 配置 | `{ clearIcon?: ReactNode }` | - | | ||
| list | List 配置 | `{ arrowIcon?: ReactNode }` | - | | ||
| navBar | NavBar 配置 | `{ backIcon?: ReactNode }` | - | | ||
| noticeBar | NoticeBar 配置 | `{ icon?: ReactNode, closeIcon?: ReactNode }` | - | | ||
| popup | Popup 配置 | `{ closeIcon?: ReactNode }` | - | | ||
| result | Result 配置 | `{ successIcon?: ReactNode, errorIcon?: ReactNode, infoIcon?: ReactNode, waitingIcon?: ReactNode, warningIcon?: ReactNode }` | - | | ||
| searchBar | SearchBar 配置 | `{ icon?: ReactNode }` | - | | ||
| toast | Toast 配置 | `{ successIcon?: ReactNode, failIcon?: ReactNode, loadingIcon?: ReactNode }` | - | | ||
|
||
[zh-CN]: https://github.com/ant-design/ant-design-mobile/blob/master/src/locales/zh-CN.ts |
Oops, something went wrong.