Skip to main content

API List

API List​

Method NameDescription
startInitialize the LI PASS Web Component
unmountUninstall/Disable the LI PASS Web Component
changeLanguageTo switch languages, see the Language List for supported languages.
onListen for events; see the Event List for supported events.
bindHow to Link LI PASS

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 and render componentaccountApi
onCloseClose the component by clicking the close button in modal modeaccountApi
onLoginLogin Successfulerror, accountApi
onLoginErrorLogin failederror
onLoginTabChangeTab Switch on the ComponentactiveTab
onRegisterRegistered successfullyerror, accountApi
onRegisterErrorRegistration failederror
onPwdResetPassword reset successfulaccountApi
onPwdResetErrorPassword reset failederror, accountApi

bind​

See binding for details.