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