无法解析CSS
我正在学习NativeScript并遵循这里的指南。 但我似乎无法让特定于平台的CSS工作,我在运行代码时遇到了错误“错误:无法解析app.component.common.CSS.Looked:/data/data/org.nativescript.portalesapp/files/app/app.component.common.CSS”。 我的文件如下: app.component.ts无法解析CSS,css,angular,nativescript,nativescript-angular,Css,Angular,Nativescript,Nativescript Angular,我正在学习NativeScript并遵循这里的指南。 但我似乎无法让特定于平台的CSS工作,我在运行代码时遇到了错误“错误:无法解析app.component.common.CSS.Looked:/data/data/org.nativescript.portalesapp/files/app/app.component.common.CSS”。 我的文件如下: app.component.ts @Component({ selector: "ns-app", moduleId: module
@Component({
selector: "ns-app",
moduleId: module.id,
templateUrl: "app.component.html",
styleUrls: ["app.component.css"]
})
app.component.common.css
.page{
background-color: #F4F5F7;
font-family:Poppins-Regular, Poppins
}
app.component.android.css
@import './app.component.common.css';
.page {
background-color: blue;
}
我完全按照指南去做,但我不确定哪里做错了 我更改“@import.”/app.component.common.css”;到@import'/app.component.common.css';它是有效的。我不知道为什么尝试使您的样式URL:
['./app.component.css']
(相对路径)。否则,请将您的common.css重命名为app.common.css
@PierreDuc谢谢您的回复。有一个问题,我想如果我们使用moduleId,那么./就不再需要了?