我有一个组件,它所做的只是渲染,它是这样的:@Component({selector:'my-comp',host:???,template:``})exportdefaultclassMyComp{@Input()title:string;publicisChanged:boolean;}该组件有一个isChanged属性,我想根据该isChanged属性在宿主元素上应用样式。这可能吗? 最佳答案 您为此使用class和style前缀。这是一个示例:@Component({selector:'my-comp',host:{'[cl