Bootstrap主题未被应用

Rya*_*ing 9 ngx-datatable

我正在尝试将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吗?我没有正确包含某些内容吗?

Fra*_*rzi 5

确保将scss文件包含在构建中.

.angular-cli.json你应该添加它:

"apps": [
  {
    ...
    "styles": [
      ...
      "../node_modules/@swimlane/ngx-datatable/release/themes/bootstrap.css",
      ...
    ],
Run Code Online (Sandbox Code Playgroud)

<ngx-datatable>元素也应该有bootstrapngx-datatable类:

<ngx-datatable class="bootstrap ngx-datatable">
Run Code Online (Sandbox Code Playgroud)