Switch
Container properties
All component configurations support Container properties at the first level.
Component properties
| Name | Type | Default | Supports Variable Pattern | Description |
|---|---|---|---|---|
| className | string | ✔️ | The className of the component | |
| style | object | The style of the component | ||
| size | 'default' | 'small' | Optional | ||
| action | SwitchAction | Actions that occur when the Switch is clicked |
All the remaining componentsProps will be passed to the component root element(Switch)。
SwitchAction
| Name | Type | Default | Supports Variable Pattern | Description |
|---|---|---|---|---|
| type | 'request' | Types of actions | ||
| method | 'get' | 'post' | 'put' | 'delete' | When type equals request, the method to send the request | ||
| url | string | ✔️ | When type equals request, the address of the request is sent | |
| openMessage | string | When type equals request, and the Switch operation is "Open" to send the request successfully prompt message | ||
| closeMessage | string | When type equals request, and the Switch operation is "close" to send the request successfully prompt message |
JS API
The interface obtained through formApi.getFieldApi() is as follows:
| Name | Type | Description |
|---|---|---|
| node | HTML Element | The root DOM element of the component |