【问题标题】:Ionic4 Ion-select style property not workingIonic4 离子选择样式属性不起作用
【发布时间】:2019-05-07 09:16:17
【问题描述】:

我想为我的警报控制器应用 css 属性但不工作。

home.html

   <ion-select [(ngModel)]="accountSystem" placeholder="Match Accounting  Standard"  okText="Done" cancelText="Cancel"   class="select-account">
                  <ion-select-option value="PRC Gaap">PRC Gaap</ion-select-option>
                  <ion-select-option value="IFRS">IFRS</ion-select-option>
                  <ion-select-option value="US Gaap">US Gaap</ion-select-option>
              </ion-select>

global.scss

   .select-account{
.alert-wrapper{
    .alert-button-inner{
    color:rgb(239,52,52);
    }
    .alert-button{
    color:rgb(52,223,57);
    }
}}

【问题讨论】:

  • 你到底想给 select css 还是 alert box css 什么?如果您想提醒框 css,那么我在下面分享了我的解决方案,请检查它

标签: ionic-framework ionic4


【解决方案1】:

这是我在项目中的工作解决方案。

home.ts

const alert = await this.alertCtrl.create({
      header: "Alert",
      mode: "ios",
      cssClass: "codealert",
          buttons: [
       {
          text: 'Cancel',
          role: 'cancel',
          cssClass: 'alertbutton',
          handler: () => {
            console.log('Confirm Cancel');
          }
        }, {
          text: 'Ok',
          cssClass: 'alertbutton',
          handler: () => {
            console.log('Confirm Ok');
          }
        }
      ]
    });

    await alert.present();
  }  

global.scss

.codealert {
  --background: white;
}
.alertbutton {
  color: #600001 !important;
  font-weight: bold;
}

【讨论】:

    猜你喜欢
    • 2017-11-28
    • 1970-01-01
    • 2018-09-24
    • 1970-01-01
    • 1970-01-01
    • 2018-01-07
    • 2023-04-10
    • 2020-01-13
    • 1970-01-01
    相关资源
    最近更新 更多