css - Angular 2 中的 PrimeNG 样式问题
问题描述
我正在尝试使用 PrimeNG 的日历组件,但样式不起作用。这些是我采取的所有步骤:
我使用以下命令安装了 PrimeNG:npm i primeng
我在 app.module.ts 中导入了 CalendarModule:
import {CalendarModule} from 'primeng/calendar';
并将其放入我的导入[]:
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
ReactiveFormsModule,
FormsModule,
NgbModule,
SocketIoModule.forRoot(config),
BrowserAnimationsModule,
CalendarModule,
],
我将样式表添加到我的 angular.json 中:
"styles": [
"src/styles.css",
"../node_modules/primeng/resources/themes/bootstrap/theme.css" ,
"../node_modules/primeng/resources/primeng.css",
],
我在我的一个组件中插入了一个 p 日历,如下所示:
<label for="publishedAt">Published At:</label>
<p-calendar
[(ngModel)]="news.publishedAt"
name="publishedAt"
id="publishedAt"
required
#publishedAt="ngModel"
showTime="true"
hourFormat="12"
>
</p-calendar>
但我的日历是这样的:
有什么我错过的吗?
解决方案
推荐阅读
- mysql - SQL 优化 - 查询耗时 15 秒
- android - 如果 build 在 termux 中,如何检查 configure.ac
- jmeter - Jmeter-正则表达式提取-如何获取属性名的值
- vba - 在特定时间范围内阅读 Outlook 电子邮件
- spring-boot - Openshift/Kubernetes ssh Secret 不适用于 Camel SFTP 组件
- python - 单击按钮或在文本框中键入时检索元素名称和 xpath
- android - 我们如何在谷歌地图上实现标记放大和缩小功能
- swift - Xcode 11 - Firebase 问题(没有这样的模块“Firebase”)
- node.js - Firebase HTTP 云函数错误“无法获取 /”
- python - Selenium 在不同的实例中区分相同的按钮