本文整理汇总了TypeScript中ionic-angular.ActionSheet.present方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ActionSheet.present方法的具体用法?TypeScript ActionSheet.present怎么用?TypeScript ActionSheet.present使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.ActionSheet
的用法示例。
在下文中一共展示了ActionSheet.present方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: share
share(concert) {
let actionSheet: ActionSheet = this.actionSheetCtrl.create({
title: 'Share via',
buttons: [
{
text: 'Twitter',
handler: () => console.log('share via twitter')
},
{
text: 'Facebook',
handler: () => console.log('share via facebook')
},
{
text: 'Email',
handler: () => console.log('share via email')
},
{
text: 'Cancel',
role: 'cancel',
handler: () => console.log('cancel share')
}
]
});
actionSheet.present();
}
示例2: generate
generate(bank : Bank) {
const contextMenu = new ContextMenu(bank.name, this.translate);
//contextMenu.addItem('REORDER', () => this.reoder(bank));
contextMenu.addItem('REMOVE', () => this.remove(bank));
contextMenu.addItem('RENAME', () => this.rename(bank));
//contextMenu.addItem('Copy to local', () => console.log('Cancel clicked'));
this.instance = contextMenu.generate(this.page.actionSheet);
this.instance.present();
}
示例3: presentActionSheet
private async presentActionSheet(action:string):Promise<void> {
let buttons:Array<Object> = new Array<Object>();
let actionSheet:ActionSheet;
let tags:string = await this.configService.getStatusCakeTags();
if(tags != null) {
// tags is a comma separated string
let tagArray = tags.split(',');
for (let tag of tagArray) {
tag = tag.trim();
buttons.push(
{
text: action.charAt(0).toUpperCase() + action.slice(1) + ' tag ' + tag,
handler: () => {
this.doApiAction(action, tag);
}
}
);
}
}
buttons.push(
{
text: 'Cancel',
role: 'cancel',
handler: () => {}
}
);
actionSheet = this.actionSheetCtrl.create({
title: 'Which tag should be ' + action + 'd?',
buttons: buttons
});
actionSheet.present();
}