下面是我的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>
答案 0 :(得分:8)
在.sass
中覆盖此类.alert-radio-label {
white-space: normal!important;
}
答案 1 :(得分:-1)
将以下内容添加到main.css
或app.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;}