我正在尝试将Bootstrap主题应用于我的数据表.我使用的是ngx-datatable10.4.0版,因为我仍然使用Angular 4而且11.0不兼容.根据更改日志,Bootstrap主题在版本10.3.0中添加.
以下是我的component.html:
<div>
<ngx-datatable class="bootstrap" [rows]="rows" [columns]="columns" (select)='onSelect($event)' [selected]="selected" [selectionType]="'single'"
[limit]="10" [columnMode]="'force'" [headerHeight]="40" [footerHeight]="40" [rowHeight]="'auto'">
</ngx-datatable>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,这不会像演示中那样添加样式.我想我已经包含了文档显示的所有内容.
我正在使用Bootstrap 3.3.7.需要4.0吗?我没有正确包含某些内容吗?
确保将scss文件包含在构建中.
在.angular-cli.json你应该添加它:
"apps": [
{
...
"styles": [
...
"../node_modules/@swimlane/ngx-datatable/release/themes/bootstrap.css",
...
],
Run Code Online (Sandbox Code Playgroud)
<ngx-datatable>元素也应该有bootstrap和ngx-datatable类:
<ngx-datatable class="bootstrap ngx-datatable">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2426 次 |
| 最近记录: |