Skip to main content

API List

API List

Method NameDescription
startInitialize LI PASS Web Component
unmountUnload/Close LI PASS Web Component
changeLanguageSwitch language, supported languages see language list
onMonitor events, supported events see event list
bindLI PASS Binding Method

unmount

Calling the unmount method will remove the LI PASS Web component from the DOM.

changeLanguage

You can switch the component language by calling the changeLanguage method; if the input language parameter is not supported, the default language en will be displayed.

Example

// Component switches language to Italian\npass.changeLanguage("it");

Language List

CodeLanguage Type
arArabic
csCzech
deGerman
enEnglish
esSpanish (Latin America)
es-euSpanish (Europe)
fiFinnish
fil-PHFilipino
frFrench
hiHindi
idIndonesian
itItalian
jaJapanese
koKorean
msMalay
nlDutch
plPolish
ptPortuguese (Latin America)
ruRussian
thThai
trTurkish
viVietnamese
zh-HantChinese (Traditional)
zh-HansChinese (Simplified)
zh-TWChinese (Taiwan)

on

The on method provided by the pass component can register callback event handlers.When the user performs operations on the LI PASS Web component, the component will call back at the appropriate times.

note

Ensure to register the event before the user triggers the corresponding event.

Example

pass.on("onLogin", (userInfo) => {\n  // After the user fails to log in, the 'onLoginError event' is triggered, and the business logic after successful login can be processed in this event callback\n  // such as redirecting to a specific page\n  console.log(userInfo);\n});\n\npass.on("onLoginError", (userInfo) => {\n  // After the user successfully logs in, the 'onLogin event' is triggered, and the business logic after failed login can be processed in this event callback\n  console.log(userInfo);\n});\n\npass.on("onRegister", (userInfo) => {\n  // Logic added after successful registration\n  // such as redirecting to a specific page\n  console.log(userInfo);\n});

Event List

Method NameDescriptionCallback Parameters
onLoadLoad Rendered ComponentaccountApi
onCloseClose component by clicking close button in modal modeaccountApi
onLoginLogin SuccessfuluserInfo, accountApi
onLoginErrorLogin Failederror
onLoginTabChangeTab Switch on ComponentactiveTab
onRegisterRegistration SuccessfuluserInfo, accountApi
onRegisterErrorRegistration Failederror
onPwdResetPassword Reset SuccessfulaccountApi
onPwdResetErrorPassword Reset Failederror, accountApi

bind

See binding for details.