Create Tax Form Element

createElement('taxForm', options?)

Use this function to create an instance of an individual Element.

Parameters

typerequired'taxForm'

The type of element you are creating.

optionsoptionalTaxFormElementOptions

Options for creating taxForm Element.

Returns

TaxFormElement | null
linkTypeScript
1import { createElement } from '@airwallex/components-sdk';
2
3const taxFormElement = await createElement('taxForm');

TaxFormElementOptions

Options for creating the Tax Form Element.

localeoptional'en'

The locale for the Element, applied to Element UI strings and error messages. By default, the locale configured in init() is used.

prefillDataoptional

Prefilled data to populate the form fields.

TaxFormElement

Functions and external fields can be used in your integration flow with Tax Form Element.

destroy()

Destroys the Element instance.

Returns

void
linkTypeScript
1element.destroy();

mount(domElement)

Mounts Element to your HTML DOM.

Parameters

domElementrequiredstring | HTMLElement

The container DOM element to mount the element.

Returns

void
linkTypeScript
1// type
2element.mount: (domElement: string | HTMLElement) => void
3
4// There are two ways to mount element:
5// 1. call with container dom id
6element.mount('container-dom-id');
7
8// 2.find the created DOM in existing HTML and call with container DOM element
9const 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

void
linkTypeScript
1element.on('cancel', () => {
2 // Handle cancel event
3});

unmount()

Unmounts the Element. Note that the Element instance will remain.

Returns

void
linkTypeScript
1element.unmount();