typescript IF_04_20_Actionsheet_TS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript IF_04_20_Actionsheet_TS相关的知识,希望对你有一定的参考价值。

import { Component } from '@angular/core';
import { ActionSheetController } from '@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {

  constructor(public actionsheetCtrl: ActionSheetController) {

  }

  async showActionsheet() {

    let actionsheet = await this.actionsheetCtrl.create({
      header: "Options",
      subHeader: "Select an option",
      buttons: [{
        text: "Delete",
        icon: "trash",
        role: "destructive",
        handler: () => {
          console.log("You tapped on Delete button");
        }
      }, {
        text: "Edit",
        icon: "create",
        handler: () => {
          console.log("You tapped on Edit button");
        }
      }, {
        text: "Share",
        icon: "share",
        handler: () => {
          console.log("You tapped on Rename button");
        }
      }, {
        text: 'Cancel',
        icon: 'close',
        role: 'cancel',
        handler: () => {
          console.log('Cancel clicked');
        }
      }]
    });
    actionsheet.present();

  }

}

以上是关于typescript IF_04_20_Actionsheet_TS的主要内容,如果未能解决你的问题,请参考以下文章

typescript IF_04_18_AlertController_TS

typescript IF_04_16_ToastController_TS

typescript IF_04_14_LoadingController_TS

typescript IF_04_10_Checkbox_Binding_2_TS

typescript IF_04_12_Select_Binding_TS

typescript IF_04_08_Checkbox_Binding_TS