我想在 primeng 'p-overlayPanel' 元素上放置条件样式。我努力了:
<p-overlayPanel [styleClass]="#{(bean.comment) ? 'style1' : 'style2'}">,但它不起作用。[ng-class]="bean.comment ? 'style1' : 'style2'"- 这也不起作用。Styleclass 仅在没有条件的情况下才有效,如下所示:
<p-overlayPanel [styleClass]="style1">// html 文件
p-overlayPanel .style1.ui-overlay { background-color: yellow; }// CSS 文件
虽然 [ng-class] 根本不起作用(但在普通 JS 元素上工作得很好)。我错过了什么吗?我的问题如下:
p-overlayPanel元素应用“styleClass”?我正在使用 Angular 8。