【问题标题】:Angular Material paginator hides the buttons and number of pages by the global background colorAngular Material 分页器通过全局背景颜色隐藏按钮和页数
【发布时间】:2022-01-24 04:04:21
【问题描述】:

我实现了material paginator,每页的项目数和按钮(下一个和上一个)被全局背景颜色隐藏。我附上了 2 张图片,其中一张的全局背景颜色已停用,可以看到页面和按钮的数量(下一个和上一个)。

我需要保持背景颜色,并使每页的项目数以及下一页和上一页按钮可见。

例如,我确实阅读了一些重新发布的文章并进行了一些更改,

::ng-deep my-style-class {
   background-color: unset;
}

所有这些都没有工作。

您能否给我一个建议,让我在不禁用全局背景颜色的情况下显示页数和下一个、上一个按钮。

【问题讨论】:

  • 您能否创建一个可重现的最小示例来进行故障排除?有很多方法可以解决这个问题。

标签: javascript angular angular-material


【解决方案1】:

它不起作用的原因是这段代码需要一个名为 mat-paginator 和 mat-icon-button 的类。

::ng-deep .mat-paginator .mat-icon-button
{
  background-color: YourColor;
}

【讨论】:

  • 上面的代码段设置了垫子分页器的下一个和上一个按钮的颜色,但背景颜色仍然覆盖了每页的项目和下一个、上一个按钮。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-02-13
  • 1970-01-01
  • 1970-01-01
  • 2013-12-16
  • 1970-01-01
  • 2014-06-11
  • 2018-09-13
相关资源
最近更新 更多