【发布时间】:2022-01-20 23:06:03
【问题描述】:
如果组件上有(click)="..."属性,有没有办法改变宿主的样式?
类似这样的:
app.component.html
<my-example (click)="..."></my-component>
my-example.component.scss
:host {
cursor: default;
}
/* If element has (click) attribute use this style */
:host-context([(click)]) {
cursor:pointer;
}
【问题讨论】: