问题描述
我正在尝试使用 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>
但我的日历看起来像这样:
有什么我遗漏的吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)