Segment

http://ionicframework.com/docs/v2/components/#segment

Segment是在一行内显示的按钮的集合。它们可以用来作为一个过滤器,基于不同的值来显示或隐藏元素。

更多内容请查看API文档。

基本用法

<div padding>
    <ion-segment [(ngModel)]="pet">
        <ion-segment-button value="kittens">
            Kittens
        </ion-segment-button>
        <ion-segment-button value="puppies">
            Puppies
        </ion-segment-button>
    </ion-segment>
</div>
<div [ngSwitch]="pet">
    <ion-list *ngSwitchCase="'puppies'">
        <ion-item>
            <ion-thumbnail item-left>
                <img src="img/thumbnail-puppy-1.jpg">
            </ion-thumbnail>
            <h2>Ruby</h2>
        </ion-item>
        ...
    </ion-list>
    <ion-list *ngSwitchCase="'kittens'">
        <ion-item>
            <ion-thumbnail item-left>
                <img src="img/thumbnail-kitten-1.jpg">
            </ion-thumbnail>
            <h2>Luna</h2>
        </ion-item>
        ...
    </ion-list>
</div>

results matching ""

    No results matching ""