本文整理汇总了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);
});