PrimeNg CSS 不工作

Ama*_*mar 4 html css primeng angular

我可以得到<button pButton type="button" class="ui-button-danger"></button>,但它不会风格化。我已在我的index.html 中链接了primeng.min.css。但我假设我的.angular-cli.json文件有错误,因为样式部分是空的。

编辑:控制台错误说:无法加载资源:服务器响应状态为 404(未找到),但<link rel="stylesheet" type="text/css" href="/node_modules/primeng/resources/primeng.min.css" />我已经仔细检查过,它就在那里。

小智 6

您只想在 styles.css 中包含如下所示的条目

@import '../node_modules/primeng/resources/primeng.min.css';
@import '../node_modules/primeng/resources/themes/nova-light/theme.css';
@import '../node_modules/primeicons/primeicons.css';
Run Code Online (Sandbox Code Playgroud)

并且 angular.json 的 styles 数组中不需要任何条目