Skip to main content

Button

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.
type'default' | 'primary' | 'ghost' | 'dashed' | 'link' | 'text''default'The appearance type of the button.
size'small' | 'middle' | 'large''middle'The size of the button.
contentstring'middle'The text content of the button.
iconstringThe name of the button's icon.
actionButtonActionThe action associated with the button.
clickUseCaptureboolfalseWhether to trigger the click event in the capture phase.
onClickfuncThe function to be called when the button is clicked.
@param {object} event: dom event

All other componentsProps will be passed to the root element of the component(Button)。

ButtonAction

NameTypeDefaultSupports Variable PatternDescription
type'submit' | 'save' | 'cancel' | 'refresh' | 'refreshPage' | 'refreshTable' | 'refreshData' | 'dialog' | 'request' | 'setFormData' | download' | 'upload' | link' | 'globalMethod' | 'formMethod' | 'logout' | 'confirm' | 'updateTableRow' | 'scanCode'action type
method'get' | 'post' | 'put' | 'delete'When type is request, the requested method
urlstring✔️The address requested when type is request, download, upload
hrefConditionalPropertyPropType(string)✔️When type is `link', the link address
hrefIsSiteBasedboolfalseIf the value is false and this link is under pbc, href will automatically splice the token of pbc as basename, and the mobile side will automatically splice the prefix of mobile
suppressBasePathboolfalseWhether the direct link does not go through the base path of the react router
suppressInheritIncludeDeletedboolfalseIs it prohibited to automatically inherit the include_deleted property of the current page. This property is generally in the search params of the url of the current page.
targetstringWhen type is `link', the target property of the html a tag
replaceboolfalseWhen the type is 'link', react-router Link's replace property
requestDataobjectformData✔️When the type is 'request', the data sent to the server
acceptstring✔️When the type is 'upload', the accepted file types are uploaded
openFormPropsobjectfalseWhen type is open, the open form property is compatible with all FormRenderer properties
openDialogPropsOpenDialogPropsWhen type is open, the properties of the open Dialog
msgstring✔️When the type is submit, save, request, download, upload, upload, , , prompt message for success
uploadingMsgstringWhen the type is 'upload', a message is being uploaded
uploadFileKeystringWhen type is 'upload', the file uploaded to the server is named in the field of the request
successActionButtonActionThe button's event can be used recursively after another event is executed after it has been successful
suppressSuccessLinkDelayboolBy default, link in successAction will has 2s delay
successLinkDelayTimenumber2000Customize the delay time (ms) of the link action in successAction
globalMethodstringWhen type is globalMethod, the method name on the called window object
filenamestringWhen type is 'download', the name of the downloaded file
titlestringWhen type is confirm, the title of the confirm box
contentstringWhen type is confirm, the contents of the confirm box
updateType'add' | 'update' | 'remove'When type is updateTableRow, the updated operation type
rowDatastring | objectWhen type is updateTableRow, the updated data

OpenDialogProps

NameTypeDefaultSupports Variable PatternDescription
hideFooterboolfalseWhether to hide the footer of Dialog
centeredbooltrueDialog is the page centered
titlestringDialog title
disableUseOpenContentTitleboolfalseBy default, when openDialogProps.title does not exist, the dialog will use the title of the page / form that opens the pop-up window as the title of the dialog. Set true to prohibit this behavior.
size'xs' | 'sm' | 'md' | 'lg' | 'fullscreen''sm'Get the address of the detailed data based on id.
widthnumber | stringCustom Width of Dialog
okTextstring'Sure'The text of the "OK" button of Dialog footer
cancelTextstring'Cancel'Text of the "Cancel" button of Dialog footer
okPropsobjectDialog footer's "OK" button props
cancelPropsobjectProps of the "Cancel" button of Dialog footer

JS API

The interface obtained through formApi.getFieldApi() is as follows:

NameTypeDescription
nodeHTML ElementThe root DOM element of the component
setLoading() => voidSet Button loading status