【发布时间】:2017-06-27 10:10:48
【问题描述】:
我想在这段代码中添加 css,但我不想内联。 当我在 scss 类中更改它时,它似乎没有应用于元素。
这是html
<ion-content #popoverContent class="popover-page">
<div id="map" #popoverText ></div>
这是 .ts 文件中的弹出内容
@Component({
template :`
<ion-list>
<ion-list-header>Ionic</ion-list-header>
<button ion-item (click)="close()">Learn Ionic</button>
<button ion-item (click)="close()">Documentation</button>
<button ion-item (click)="close()">Showcase</button>
<button ion-item (click)="close()">GitHub Repo</button>
</ion-list>`
})
export class PopoverPage {
constructor(public viewCtrl: ViewController) {}
close() {
this.viewCtrl.dismiss();
}
所以当我在 .scss 文件中更改它时,它不会做任何事情
ion-list-header {
background-color: red;
}
我真的不想添加内联 css,有人知道如何修复它吗?
【问题讨论】:
-
在我的 ionic 2 应用程序中,
theme文件夹中有app.core.scss文件。这里需要导入所有.scss文件。你能检查它是否包括在内。如果是,您能否检查该元素并检查background-color优先考虑的位置?请回复您的发现。 :)