找不到PrimeNG样式表 [英] PrimeNG stylesheets not found
问题描述
我在创建一个新项目时遇到了麻烦.由于某些原因,当尝试导入PrimeNG样式表时,出现404错误.我不知道这与我的项目的配置有关.
我正在使用Angular Class WebPack Starter,我添加了PrimeNG,但是如上所述,我遇到了404错误.尽管没有太大意义,但我怀疑这与样式表位于node_modules
文件夹中有关.作为测试,我已将.css
文件放在node_modules
文件夹中,但未找到.但是,当将其放入我的公共资产的全局"文件夹中时,找到了该文件.
包含测试样式表和PrimeNG主题的屏幕截图
屏幕截图,其中测试样式表已移至public
文件夹,且PrimeNG主题已
我知道这是一个小问题,但是我似乎找不到任何信息.以防万一,我还查看了 PrimeNG的设置页,但是它没有使差异.
我对Angular2应用程序也遇到了同样的问题,并通过将.css文件直接导入到我的main.ts脚本中设法解决了这个问题.
这篇文章对我有帮助:
Screenshot with the test stylesheet and the PrimeNG theme Screenshot with the test stylesheet moved to I know it's a trivial issue but I can't seem to find any information. Just in case I've also looked at PrimeNG's setup page however it did not make a difference. I had the same with problem with a Angular2 app and managed to get around it by importing the .css files directly into the my main.ts script. This post helped me : Example of how to load static CSS files from node_modules using webpack? I just followed the instruction in the post mentioned above and added this to my main.ts. Hope this helps. 这篇关于找不到PrimeNG样式表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!public
folder and the PrimeNG themeimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import 'primeng/resources/themes/afterdark/theme.css';
import 'font-awesome/css/font-awesome.min.css';
import 'primeng/resources/primeng.min.css';
import { AppModule } from './modules/app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);