antom.createElement()
antom.createElement() is a factory method. After successfully calling loadAntom() to load the SDK and obtain the antom instance, you can use this method to dynamically create the corresponding payment or card binding element instance by passing in the specified elementType.
Method signature
When calling this method, please use the following standard method signature format.
antom.createElement(elementType, options)Parameters
This method accepts two parameters, which specify the type of element to be created and its configuration.
Parameter | Data type | Required | Description |
elementType | String | Yes | Element type, valid values are:
|
| Object | No | A configuration object used to set the appearance theme and multilingual environment of components. |
options
Parameter | Data type | Required | Description |
| appearance | Object | No | Used for custom appearance configuration. For more information, refer to Appearance customization. It contains the following parameters:
|
| locale | String | No | Multilingual configuration.
Valid values are:
|
Return value
This method returns an element instance object that provides methods for mounting, unmounting, destroying, and updating configurations, enabling flexible management of the component lifecycle on the page.
| Function | Description |
Register event listeners for the Element instance. | |
element.mount() | Used to mount an element to a specified page node, and can be passed in a specific HTMLElement. |
element.unmount() | Unmount the current Element (can be remounted). |
element.destroy() | Destroy the current Element (cannot be remounted). |
element.updateConfig() | Update the configuration. |
Error codes
Use the element.on() method to listen for error codes related to the antom.createElement() method. For a detailed list of error codes, please refer to the Error codes.