ionic3创建选项卡

时间:2022-03-20 16:51:22

html页面

<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文件里

public tabs = 'gatewaySignal';