CSS问题Ngx-table angular2泳道

前端之家收集整理的这篇文章主要介绍了CSS问题Ngx-table angular2泳道前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_404_0@
我目前遇到的问题是让ngx-datatable拥有正确的css.我在我的css文件中有这个导入正确的CSS.
@import '@swimlane/ngx-datatable/release/index.css';
@import '@swimlane/ngx-datatable/release/themes/material.css';
@import '@swimlane/ngx-datatable/release/assets/icons.css';

它似乎只做了它想做的事情的一半.这是我的html调用库的部分.

<ngx-datatable  class="material striped"
    class="material"
    [rows]="rows"
    [columns]="columns"
    [columnMode]="'force'"
    [headerHeight]="50"
    [footerHeight]="50"
    [rowHeight]="100">
  </ngx-datatable>

如果有人知道为什么会这样,那将非常有帮助.

@amcdnl任何线索,如果你读到这个,很抱歉打扰你

CSS Issue

解决方法

我认为它与视图封装有关.基本上你的css将使用像[_ngcontent-c5]这样的属性,因为模板里面的元素会自动拥有它.

但是,由数据表添加到dom的项目可能没有该属性导致样式不执行任何操作.

你可以通过向你的组件添加选项封装:ViewEncapsulation.None来解决这个问题:

import { ViewEncapsulation } from '@angular/core';
@Component({
  [...] // other code like template and style urls
  encapsulation: ViewEncapsulation.None
})
原文链接:https://www.f2er.com/css/215737.html

猜你在找的CSS相关文章