Nativescript CSS-错误:require的第一个参数应该是字符串

尝试为我的应用程序组件创建平台特定的CSS时出现以下错误。我的android.css工作正常,但common.css无效。有什么想法吗?

JS: Error: /app.component.common.css does not start with /data/data/org.nativescript.portalestapp/files/app

JS: Error: Could not load CSS from /app.component.common.css: Error: require's first parameter should be string

我有以下文件: app.component.html

app.component.ts

app.component.common.css

app.component.android.css

app.component.ios.css

app.component.ts:

@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
}

.custom-action-bar {
    background-color:transparent;
}

app.component.android.css:

@import "/app.component.common.css";

.page {
    background-color: #fffffffa;
}
jenny013 回答:Nativescript CSS-错误:require的第一个参数应该是字符串

page{
    background-color: #F4F5F7;
    font-family:Poppins-Regular,Poppins
}

custom-action-bar {
    background-color:transparent;
}

您的第一项必须是字符串

本文链接:https://www.f2er.com/3169013.html

大家都在问