Ionic 2文本不包含在选择组件中

时间:2017-01-16 08:37:55

标签: html text ionic2 textwrapping

下面是我的HTML代码,但不知何故text-wrap在此选择组件中不起作用。有人有想法吗?

<ion-list>
  <h5 color="primary">
    Choose:
  </h5>

  <ion-item text-wrap>
    <ion-select text-wrap class="selectWidth" okText="Ok" cancelText="Cancel" [selectOptions]="selectOptions" [(ngModel)]="Decision">
      <ion-option text-wrap selected="true" color="primary" value="vone" text-wrap>first first first first first</ion-option>
      <ion-option text-wrap color="primary" value="vtwo">second second second second second second second</ion-option>
      <ion-option text-wrap color="primary" value="vthree">third third third third third</ion-option>
    </ion-select>
  </ion-item>
</ion-list>

2 个答案:

答案 0 :(得分:8)

在.sass

中覆盖此类
.alert-radio-label {
    white-space: normal!important;
}

答案 1 :(得分:-1)

将以下内容添加到main.cssapp.scss可以解决问题:

.alert-ios .alert-radio-label{ white-space: pre-line;}
.alert-md .alert-radio-label{ white-space: pre-line;}
.alert-wp .alert-radio-label{ white-space: pre-line;}
.select-text { white-space: pre-line;}