angular 样式穿透问题

1,277 阅读1分钟

angular4单个组件样式不生效的问题,只能在asset/style.css公共样式文件中去覆盖,为了防止这种问题,可以使用:host /deep/ {}包裹样式,例如: :host /deep/ { #financialPerf{ p-tabview.netProfit .ui-tabview.ui-widget-content { box-shadow: 0 2px 10px 0 rgba(132,144,250,0.27); } } }