ant-design/components/config-provider/index.zh-CN.md
Jack Lo 929418fa25 Update index.zh-CN.md
笔误:customizeRenderEmpty => renderEmpty
2019-01-10 13:18:38 +08:00

34 lines
875 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
category: Components
subtitle: 全局化配置
cols: 1
type: 其他
title: ConfigProvider
---
为组件提供统一的全局化配置。
## 使用
ConfigProvider 使用 React 的 [context](https://facebook.github.io/react/docs/context.html) 特性,只需在应用外围包裹一次即可全局生效。
```jsx
import { ConfigProvider } from 'antd';
// ...
return (
<ConfigProvider {...yourConfig}>
<App />
</ConfigProvider>
);
```
## API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| renderEmpty | 自定义组件空状态。参考 [空状态](/components/empty/) | Function(componentName: string): ReactNode | - |
| getPopupContainer | 弹出框Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | Function(triggerNode) | () => document.body |
| prefixCls | 设置统一样式前缀 | string | ant |