2021-09-17 00:18:50 +08:00
|
|
|
---
|
|
|
|
title: Config Provider
|
2021-10-22 19:32:39 +08:00
|
|
|
lang: en-US
|
2021-09-17 00:18:50 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
# Config Provider
|
2021-07-26 00:24:30 +08:00
|
|
|
|
|
|
|
Config Provider is used for providing global configurations, which enables your entire application to access these configurations everywhere
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## i18n related configurations
|
2021-07-26 00:24:30 +08:00
|
|
|
|
|
|
|
Configure i18n related properties via Config Provider, to get language switching feature
|
|
|
|
|
|
|
|
:::demo Use two attributes to provide i18n related config
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
config-provider/usage
|
2021-07-26 00:24:30 +08:00
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-11-05 18:10:07 +08:00
|
|
|
## button configurations
|
|
|
|
|
2021-11-05 20:49:57 +08:00
|
|
|
:::demo
|
2021-11-05 18:10:07 +08:00
|
|
|
|
|
|
|
config-provider/button
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2022-01-08 20:03:13 +08:00
|
|
|
## message configurations
|
|
|
|
|
|
|
|
:::demo
|
|
|
|
|
|
|
|
config-provider/message
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
## Config Provider Attributes
|
2021-07-26 00:24:30 +08:00
|
|
|
|
2022-01-08 20:03:13 +08:00
|
|
|
| Attribute | Description | Type | Accepted Values | Default |
|
|
|
|
| --------- | ----------------------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------- | ----------------------- |
|
|
|
|
| locale | Locale Object | Object\<Language\> | [languages](https://github.com/element-plus/element-plus/tree/dev/packages/locale/lang) | English |
|
|
|
|
| size | global component size | string | large / default /small | default |
|
|
|
|
| zIndex | global Initial zIndex | number | - | - |
|
|
|
|
| button | button related configuration, [see the following table](#button-attributes) | ButtonGlobalConfig | - | see the following table |
|
|
|
|
| message | message related configuration, [see the following table](#message-attributes) | MessageGlobalConfig | - | see the following table |
|
2021-11-05 18:10:07 +08:00
|
|
|
|
2021-11-10 09:38:05 +08:00
|
|
|
## Button Attributes
|
2021-11-05 18:10:07 +08:00
|
|
|
|
|
|
|
| Attribute | Description | Type | Accepted Values | Default |
|
|
|
|
| --------------- | ----------------------------------------------------------- | ------- | --------------- | ------- |
|
2021-11-10 15:21:20 +08:00
|
|
|
| autoInsertSpace | automatically insert a space between two chinese characters | boolean | - | false |
|
2021-10-04 08:26:51 +08:00
|
|
|
|
2022-01-08 20:03:13 +08:00
|
|
|
## Message Attributes
|
|
|
|
|
|
|
|
| Attribute | Description | Type | Accepted Values | Default |
|
|
|
|
| --------- | --------------------------------------------------------------------- | ------ | --------------- | ------- |
|
|
|
|
| max | the maximum number of messages that can be displayed at the same time | number | - | - |
|
|
|
|
|
2021-10-04 08:26:51 +08:00
|
|
|
## ConfigProvider Slots
|
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| ---- | ------------------------- |
|
|
|
|
| — | customize default content |
|