本文整理匯總了TypeScript中tns-core-modules/ui/dialogs.confirm函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript confirm函數的具體用法?TypeScript confirm怎麽用?TypeScript confirm使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了confirm函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: onShowDialog
onShowDialog(title: string, result: string) {
let options: any = {
title: title,
message: result,
okButtonText: "Ok"
}
confirm(options).then((result: boolean) => {
console.log(result);
})
}
示例2: onShowDialog
onShowDialog() {
let options = {
title: "Dialog",
message: "Message",
okButtonText: "Yes",
cancelButtonText: "No"
}
confirm(options).then((result: boolean) => {
console.log(result);
})
}
示例3: test_DummyTestForSnippetOnly1
export function test_DummyTestForSnippetOnly1() {
// >> dialog-confirm
var options = {
title: "Race Selection",
message: "Are you sure you want to be an Elf?",
okButtonText: "Yes",
cancelButtonText: "No",
neutralButtonText: "Cancel"
};
dialogs.confirm(options).then((result: boolean) => {
// result can be true/false/undefined
console.log(result);
});
// << dialog-confirm
}
示例4: confirmName
public confirmName(args: observable.EventData) {
dialogs.confirm({
title: "Name",
message: "Do you want to change the name?",
cancelButtonText: "No",
neutralButtonText: "Ignore",
okButtonText: "Yes"
}).then((confirmResult) => {
console.log("### Result: " + confirmResult);
if (confirmResult) {
this.set("name", "John Reese");
}
else {
this.set("name", "Harold Finch");
}
});
}