zoukankan      html  css  js  c++  java
  • 1、操作表 ActionSheet

    /* --- page1.html ---*/
     
    <ion-navbar *navbar>
      <ion-title>Tab 1</ion-title>
    </ion-navbar>
     
    <ion-content padding class="page1">
      <h2>Welcome to Ionic!</h2>
     
      <button (click) = "presentActionSheet()">我是操作框</button>
     
    </ion-content>
     
    /* --- page1.html ---*/
    /* --- page1.js ---*/
     
    import { Page, ActionSheet, NavController } from 'ionic-angular';
     
    @Page({
      templateUrl: 'build/pages/page1/page1.html'
    })
     
    export class Page1 {
      static get parameters() {
        return [[NavController]];
      }
     
      constructor(nav) {
        this.nav = nav
      }
     
      presentActionSheet() {
     
        let actionSheet = ActionSheet.create({
          title: 'Modify your album',
          buttons: [
            {
              text: 'Destructive',
              role: 'destructive',
              handler: () => {
                console.log('Destructive clicked');
              }
            },{
              text: 'Archive',
              handler: () => {
                console.log('Archive clicked');
              }
            },{
              text: 'Cancel',
              role: 'cancel',
              handler: () => {
                console.log('Cancel clicked');
              }
            }
          ]
        });
        this.nav.present(actionSheet);
      }
    }
     
    /* --- page1.js ---*/

    和 ionic1  的很像嘛。最终效果图。

    点击后。其实就是handler方法。如图

  • 相关阅读:
    Spring Boot日志管理
    JProfiler
    JProfiler学习笔记
    jprofiler安装图解
    方便!C++ builder快捷键大全
    QuickFix/N简介
    QuickFIX/N入门:(三)如何配置QuickFIX/N
    java自带线程池和队列详细讲解
    SQLYog快捷键大全
    DBCP连接池配置参数说明
  • 原文地址:https://www.cnblogs.com/dandingjun/p/5562538.html
Copyright © 2011-2022 走看看