Proveedor de configuración
Config Provider se utiliza para proporcionar configuraciones globales, lo que permite a toda la aplicación acceder a estas configuraciones en todas partes.
Configuraciones i18n
Configure las propiedades relacionadas con i18n a través del proveedor de configuración, para obtener la función de cambiar de idioma.
Use dos atributos para proporcionar configuración relacionada con i18n
Configuración de botones
Link Configurations 2.9.11
Configuración de mensajes
Empty Values Configurations 2.7.0
Supported components list
- Cascader
- DatePicker
- Select
- SelectV2
- TimePicker
- TimeSelect
- TreeSelect
Set empty-values
to support empty values of components. The fallback value is ['', null, undefined]
. If you think the empty string is meaningful, write [undefined, null]
.
Set value-on-clear
to set the return value when cleared. The fallback value is undefined
. In the date component is null
. If you want to set undefined
, use () => undefined
.
Características experimentales
En esta sección, puede aprender cómo usar el Proveedor de Configuración para proporcionar características experimentales. Por ahora, no hemos añadido ninguna característica experimental, pero en el mapa de características añadiremos algunas. Puede usar esta configuración para administrar las características que desea o no.
API
Atributos del proveedor de configuración
Nombre | Descripción | Tipo | Por defecto |
---|---|---|---|
locale | Objeto Locale | object languages | en |
size | tamaño global del componente | enum | default |
zIndex | zIndex inicial global | number | — |
namespace | prefijo global className del componente (cooperado con $namespace) | string | el |
button | configuración relacionada con el botón, vea la siguiente tabla | object | see the following table |
link | link related configuration, see the following table | object | see the following table |
message | configuración relacionada con mensajes, vea la siguiente tabla | object | see the following table |
experimental-features | características en la etapa experimental a ser añadidas, todas las características son definidas como falsas | object | — |
empty-values 2.7.0 | global empty values of components | array | — |
value-on-clear 2.7.0 | global clear return value | string / number / boolean / Function | — |
Atributo del botón
Atributo | Descripción | Tipo | Por defecto |
---|---|---|---|
type 2.9.11 | button type, when setting color , the latter prevails | enum | — |
autoInsertSpace | automatically insert a space between two chinese characters(this will only take effect when the text length is 2 and all characters are in Chinese.) | boolean | false |
plain 2.9.11 | determine whether it's a plain button | boolean | false |
round 2.9.11 | determine whether it's a round button | boolean | false |
Link Attribute
Atributo | Descripción | Tipo | Por defecto |
---|---|---|---|
type 2.9.11 | type | enum | default |
underline 2.9.11 | when underlines should appear | enum | hover |
Atributo del mensaje
Attribute | Descripción | Type | Default |
---|---|---|---|
max | el número máximo de mensajes que se pueden mostrar al mismo tiempo | number | — |
grouping 2.8.2 | merge messages with the same content, type of VNode message is not supported | boolean | — |
duration 2.8.2 | display duration, millisecond. If set to 0, it will not turn off automatically | number | — |
showClose 2.8.2 | whether to show a close button | boolean | — |
offset 2.8.2 | set the distance to the top of viewport | number | — |
plain 2.9.11 | whether message is plain | boolean | — |
Config Provider Slots
Nombre | Description | Ámbito |
---|---|---|
default | personaliza el contenido por defecto | config: configuración global proporcionada (heredada desde arriba) |
Fuente
Componentes • Style • Documentación