代码之家  ›  专栏  ›  技术社区  ›  Lee Merlas

如何在angular-6-datatable中更改分页器的背景色

  •  1
  • Lee Merlas  · 技术社区  · 7 年前

    所以我用 angular-6-datatable https://www.npmjs.com/package/angular-6-datatable )在我的项目中。但我似乎无法改变这个异教者的背景色。看起来是这样的:

    enter image description here

    我错过了什么?

    2 回复  |  直到 7 年前
        1
  •  1
  •   Vikas Jadhav    7 年前

    在内部添加分页器css :host /deep/ 如下图所示:

    :host /deep/ {
     /*paginator style goes here*/
    }
    

    ::ng-deep {
     /*paginator style goes here*/
    }
    
        2
  •  1
  •   Sachin Shah    7 年前

    <div class="pagination" [ngClass]={'active':pageIndex == 1}>
        <!-- pagination stuff hear...  -->
    </div>
    

    在.ts文件中

    pageIndex : any = '1';  // You have to update this when pagination value update , This way : pageIndex ++;
    

    在scss文件中

    :host ::ng-deep .pagination .active{
        background:red;
    }
    
    推荐文章