ionic3建立選項卡

html頁面javascript

<ion-content padding>

    <ion-segment [(ngModel)]="tabs">
        <ion-segment-button value="gatewaySignal">網關接受信號</ion-segment-button>
        <ion-segment-button value="taskType">任務類型</ion-segment-button>
        <ion-segment-button value="testTask">測試任務</ion-segment-button>
        <ion-segment-button value="lockRecord">門鎖記錄</ion-segment-button>
    </ion-segment>

    <div [ngSwitch]="tabs">
        <div *ngSwitchCase="'gatewaySignal'">
            1
        </div>
        <div *ngSwitchCase="'taskType'">
            2
        </div>
        <div *ngSwitchCase="'testTask'">
            3
        </div>
        <div *ngSwitchCase="'lockRecord'">
            4
        </div>
    </div>

</ion-content>

ts文件裏html

public tabs = 'gatewaySignal';
相關文章
相關標籤/搜索