本文整理匯總了TypeScript中@microsoft/sp-dialog.Dialog.alert方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Dialog.alert方法的具體用法?TypeScript Dialog.alert怎麽用?TypeScript Dialog.alert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@microsoft/sp-dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.alert方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: DoWork
private async DoWork(data: string) {
Dialog.alert(data);
// use await if you want to block the dialog before continue
//await Dialog.alert(data);
window.setTimeout(async () => {
console.log("We have waited...");
this.removeCustomizer();
}, 3000);
}
示例2: onExecute
@override
public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
switch (event.commandId) {
case 'COMMAND_1':
Dialog.alert(`Clicked ${strings.Command1}`);
break;
case 'COMMAND_2':
Dialog.prompt(`Clicked ${strings.Command2}. Enter something to alert:`).then((value: string) => {
Dialog.alert(value);
});
break;
default:
throw new Error('Unknown command');
}
}
示例3:
dialog.show().then(() => {
this._colorCode = dialog.colorCode;
Dialog.alert(`Picked color: ${dialog.colorCode}`);
});
示例4:
Dialog.prompt(`Clicked ${strings.Command2}. Enter something to alert:`).then((value: string) => {
Dialog.alert(value);
});