angular5 ngx-datatable 使用自定义的css

使用ngx-datatable,自定义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';
 
然后在ts文件中加入 ViewEncapsulation
import { ViewEncapsulation } from '@angular/core';
@Component({
[...] // other code like template and style urls
encapsulation: ViewEncapsulation.None
})
然后在css文件中自定义的style就生效了

猜你喜欢

转载自www.cnblogs.com/imagin/p/9236343.html
今日推荐