问题
I'm learning Angular. I'm working on a project. I decided to add a <p-calendar>
component from primeng
. I installed the packages also. The versions were:
"primeicons": "^2.0.0",
"primeng": "^5.2.7",
I was getting everything perfectly. See this:
But now when I want to get months only. I wanted to change it to month picker. After doing some research I came to know that month only picker is not available in primeng: ^5.2.7
. So i upgraded to:
"primeicons": "^2.0.0",
"primeng": "6.1.6",
and I also added these attributes to <p-calendar>
tag:
view="month" dateFormat="mm/yy"
Component is working fine. But Why I lost all the styling. Those circles and hover effects, etc. See this:
Honestly, I'm not very good at css and styling. Please help.
My angular.json:
"styles": [
"src/styles.scss",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/primeicons/primeicons.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
]
Is there any way to edit or overwrite the designs.
回答1:
https://www.primefaces.org/primeng/#/setup
Try adding themes inside styles array:-
angular.json
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/primeng/resources/primeng.min.css",
"node_modules/primeng/resources/themes/omega/theme.scss",
"node_modules/primeicons/primeicons.css"
]
来源:https://stackoverflow.com/questions/58900995/why-im-not-getting-proper-styling-with-p-calendar-primeng