@Component({ selector: 'page-home',templateUrl: 'home.html',styleUrls: [ './home.scss' ] <== add this }) export class HomePage {
风格如
page-home { .buttoncls {
默认封装(ViewEncapsulation.Emulated)不适用于你,因为page-home不是主组件模板的一部分,而angular将类似[_ngcontent-c0]的属性添加到样式中.
所以我们可以将page-home更改为ion-list,看看它是如何工作的:
Stackblitz Example (ViewEncapsulation.Emulated)
但我们可以禁用封装:
encapsulation: ViewEncapsulation.None
Stackblitz Example (ViewEncapsulation.None)
另见这个主题
https://github.com/stackblitz/core/issues/1
正如EricSimons在9天前评论过的那样
Hey all! We just shipped SASS and LESS support,and we also support the angular-cli.json config too 原文链接:https://www.f2er.com/angularjs/143608.html