简体   繁体   English

Ionic5:禁用离子复选框导致放置在相同离子项目中时禁用离子标签

[英]Ionic5: Disabling ion-checkbox resulted in disabling ion-label when placed in same ion-item

I'm trying to only disable ion-checkbox but this resulted in disabling the ion-label placed in the same ion-item.我试图只禁用离子复选框,但这导致禁用放置在同一离子项目中的离子标签。

<ion-item>
   <ion-label>Using GPS</ion-label>
   <ion-checkbox slot="start" [(ngModel)]='reachedUsingBeacon' disabled="true"></ion-checkbox>
</ion-item>

I tried to solve it by adding pointer-events: auto;我试图通过添加pointer-events: auto; but it didn't work.但它没有用。

ion-item {
    pointer-events: auto;
}

Any help will be appreciated.任何帮助将不胜感激。 Thanks!谢谢!

I was able to solve this issue by removing the disabled property and use css to style it accordingly:我能够通过删除 disabled 属性并使用 css 来相应地设置它的样式来解决这个问题:

.disabled {
  pointer-events: none;
  opacity: 0.6;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM