本文整理汇总了TypeScript中@microsoft/sp-dialog.Dialog类的典型用法代码示例。如果您正苦于以下问题:TypeScript Dialog类的具体用法?TypeScript Dialog怎么用?TypeScript Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dialog类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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');
}
}
示例2: 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);
}
示例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);
});