我在大学项目中使用了Ionic 3,但遇到了一些问题,我在其中添加了此代码部分headding: 'SOMETEXT <ion-label class="special-txt">$100 </ion-label>
,但其输出却像这样SOMETEXT <ion-label class="special-txt">$100 </ion-label>
不能更改.special-txt
的颜色,并且始终从输出组件
.ts
doAlertPayment() {
let options = {enableBackdropDismiss: true};
let alrt = this.popoverCtrl.create(AlertsystemPage, {
type: '1',
headding: 'SOMETEXT <ion-label class="special-txt">$100 </ion-label>
subHeadding: '',
alertMessage: this.master.language.getLanguageLabel('paymentValidPeriod'),
positiveBtnText: this.master.language.getLanguageLabel('confirmPayment'),
negativeBtnText: '',
responseData: '0',
cssClass: 'custom-popover'
},
options);
alrt.onDidDismiss(data => {
if(data){
this.showQRCode = true;
}
console.log("Action completed!");
});
alrt.present(); // present on center
}}
css
.custom-popover .special-txt {color: #f44336;}