css - Nativescript CSS - 错误:要求的第一个参数应该是字符串
问题描述
尝试为我的应用组件创建特定于平台的 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;
}
解决方案
page{
background-color: #F4F5F7;
font-family:Poppins-Regular, Poppins
}
custom-action-bar {
background-color:transparent;
}
您的第一个条目必须是一个字符串
推荐阅读
- c# - 无法使用 C# 语言在剧作家自动化中下载文件
- macos - 在我的 Mac 上安装 truffle 后,我无法在终端中运行 truffle 命令,结果总是 zsh: command not found: truffle
- xamarin.forms - 从 Xamarin 表单添加到 Ioc.Default.Configure 服务
- reactjs - React:支持使用通用 npm 包集成多个 OAuth2 授权服务器 (SSO)
- python - Twitter Stream API 提供没有文本关键字的推文
- java - 生产者消费者问题 - 找不到问题所在
- node.js - UnauthorizedError:没有授权令牌——EC2/RDS Postgres
- dialogflow-es - 实现代码错误 Webhook 调用失败。错误:不可用
- python - 已超出每日限制
- android - 有没有办法将返回添加到协程?