Skip to main content

Switch

Container properties

All component configurations support Container properties at the first level.

Component properties

NameTypeDefaultSupports Variable PatternDescription
classNamestring✔️The className of the component
styleobjectThe style of the component
size'default' | 'small'Optional
actionSwitchActionActions that occur when the Switch is clicked

All the remaining componentsProps will be passed to the component root element(Switch)。

SwitchAction

NameTypeDefaultSupports Variable PatternDescription
type'request'Types of actions
method'get' | 'post' | 'put' | 'delete'When type equals request, the method to send the request
urlstring✔️When type equals request, the address of the request is sent
openMessagestringWhen type equals request, and the Switch operation is "Open" to send the request successfully prompt message
closeMessagestringWhen 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:

NameTypeDescription
nodeHTML ElementThe root DOM element of the component