Create Tax Form Element
createElement('taxForm', options?)
Use this function to create an instance of an individual Element.
Parameters
The type of element you are creating.
Options for creating taxForm Element.
Returns
TaxFormElement | null1import { createElement } from '@airwallex/components-sdk';23const taxFormElement = await createElement('taxForm');
TaxFormElementOptions
Options for creating the Tax Form Element.
The locale for the Element, applied to Element UI strings and error messages. By default, the locale configured in init() is used.
Prefilled data to populate the form fields.
TaxFormElement
Functions and external fields can be used in your integration flow with Tax Form Element.
mount(domElement)
Mounts Element to your HTML DOM.
Parameters
The container DOM element to mount the element.
Returns
void1// type2element.mount: (domElement: string | HTMLElement) => void34// There are two ways to mount element:5// 1. call with container dom id6element.mount('container-dom-id');78// 2.find the created DOM in existing HTML and call with container DOM element9const containerElement = document.getElementById("container-dom-id");10element.mount(containerElement);
on(eventCode, handler)
Listen to Element events.
Parameters
The event code to listen for.
The callback function that will be called when the event occurs.
Returns
void1element.on('cancel', () => {2 // Handle cancel event3});