离子2如何定制离子范围?

时间:2016-12-05 20:31:23

标签: css ionic-framework range ionic2

在离子2中,我想自定义离子范围,如下所示 pic,或者我应该说:有没有办法定制离子范围?: enter image description here

这是我的代码



    <ion-row>
      <ion-item>
         <ion-range min="500" max="1500" step="500" snaps="true" color="secondary"></ion-range>
      </ion-item>
    </ion-row>
&#13;
&#13;
&#13;

这是我的范围

enter image description here

1 个答案:

答案 0 :(得分:3)

我确实找到了如何自定义&#34; ion-range&#34; ,这就是我构建的内容(我知道它看起来并不准确):

enter image description here

这是我的步骤: - 1-将图片中显示的这些代码行添加到src \ theme \ variables.scss中 enter image description here

注意:您可以使用许多变量来自定义您的离子范围ionic2 docs

2-这是我的组件代码:

&#13;
&#13;
<ion-footer>
  <ion-toolbar>
    <ion-row>
      <ion-col width-33 text-left>
        Sedan
      </ion-col>
      <ion-col width-33 text-center>
        SUV
      </ion-col>
      <ion-col width-33 text-right>
        LUX
      </ion-col>
    </ion-row>
    <ion-range (ionChange)="selectCar()" min="500" max="1500" step="500" snaps="true" [(ngModel)]="value">
    </ion-range>

  </ion-toolbar>
 </ion-footer>
&#13;
&#13;
&#13;