2017-01-16 26 views
1

這是我的HTML代碼,但不知何故文本包裝在此選擇組件中不起作用。有人有想法嗎?離子2文本不包裹在選擇組件

<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

你試過設置'白色空間:正常;'在'selectWidth'的CSS類? –

+0

是的,即使有!重要的標籤... –

+0

你可以發佈如何讓這個工作的完整代碼? selectWidth類中的內容是什麼? – user3561494

回答

2

覆蓋這個類在你.sass

.alert-radio-label { 
    white-space: normal!important; 
} 
+0

以下發布了正確答案非常感謝。你知道如何改變打開的警報框的顏色嗎?這似乎是另一個類。然後.alert-radio-label –

+0

使用這個:.alert-wrapper {background} color:purple!important; } –

+0

修復了它。謝謝:) –

-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;}