gpt4 book ai didi

html - 界面 ="popover"时无法更改 ionic 选项中的文本颜色

转载 作者:搜寻专家 更新时间:2023-10-31 23:17:35 25 4
gpt4 key购买 nike

我正在使用 ion-select 选择一个选项,我想更改 ion-option 的文本颜色。我的代码如下...

<ion-item>
<ion-select interface="popover" [(ngModel)]="selectedGrp" (ionChange)="changeGrp()">
<ion-option value="" selected disabled>Select</ion-option>
<ion-option *ngFor="let item of List;let i = index" [value]="item">{{item.name}} </ion-option>
</ion-select>
</ion-item>

没有用于执行此操作的 SASS 变量。我试过使用 css 和样式,但没有用。谁能帮我更改 ion-option 文本颜色?

最佳答案

我能够通过在 app.scss 中插入来更改文本颜色(所有 ion-options)

.item-radio.item ion-label {
color: red; //your color here
}

对于选中的选项,在颜色属性中插入一个!important

.item-radio-checked.item ion-label {
color: blue !important; //your color here for selected option
}

关于html - 界面 ="popover"时无法更改 ionic 选项中的文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51258598/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com