angular7 - Cumulocity 服务器中的 CSS 样式问题
问题描述
我已经在 cumulocity 服务器中部署了我的 angular 7 项目。构建和部署应用程序时没有错误。但是,Bootstrap CSS 样式不能正常工作。
在 package.json 中,我提到了这些依赖项。“@c8y/ngx-components”:“1004.2.0”,“@c8y/style”:“1004.2.0”,“@ng-bootstrap/ng-bootstrap”:“^4.1.0”,
解决方案
在新的 Angular Web SDK 中,Cumulocity 团队切换到ngx-bootstrap。它包含在 ngx-components 中,因此无需添加。
您的问题可能是缺少某些样式,因为 Cumulocity 只是带有引导程序的一个子集。您可能需要将引导 CSS 添加到您的应用程序以使其正常工作:
- 在 package.json 中添加品牌条目:
"c8y": {
"application": {
"name": "tutorial application",
"contextPath": "tutorial-application",
"key": "tutorial-application-key",
"brandingEntry": "./branding/branding.less",
"globalTitle": "Pied Piper IoT",
"tabsHorizontal": true
}
}
- 然后在该文件中添加@c8y 样式和引导程序:
@import '~@c8y/style/extend.less';
@import '~yourpatt/to/boostrap.css';
推荐阅读
- python - Tkinter Python:使用 OOP 一次移动多个小部件对象?
- node.js - 如何从 VSCode Deploy 转换为 Azure Pipelines?
- arrays - 将属性从对象存储到数组
- javascript - TypeError:无法读取未定义的属性“选项”| 不和谐.js
- c++ - 未初始化的局部变量 c4700
- javascript - 需要停止传播以防止在单击下拉内容时关闭菜单
- git - git log 结果与 git.api 结果不同
- javascript - 如何同步管理异步回调,以便在继续之前处理所有事件
- php - Date_format() 对我有用,但不适用于网站的共同所有者
- prolog - 为什么我的递归序言脚本不起作用?