This is an overview of the most common usage of LoginDialog. For more information about the available properties, methods, or events, head over to the complete API documentation for LoginDialog.
login()
方法显示一个对话框,用户可以在其中提供登录凭据。
该方法是 dialogs
模块的一部分。
login()
方法可在全局范围内使用。您可以在应用中的任何位置调用它。
login("Your message", "Username field value", "Password field value").then(result => {
console.log(`Dialog result: ${result.result}, user: ${result.userName}, pwd: ${result.password}`);
});
login({
title: "Your login title",
message: "Your login message",
okButtonText: "Your OK button text",
cancelButtonText: "Your Cancel button text",
userName: "Username field value",
password: "Password field value"
}).then(result => {
console.log(`Dialog result: ${result.result}, user: ${result.userName}, pwd: ${result.password}`);
});