【发布时间】:2021-08-30 05:01:33
【问题描述】:
我正在使用 Vue Bootstrap Table 组件,我想将不同的 CSS 类添加到不同的列。我希望我的第一列有 text-left,所有其他的 text-center 和最后一个(右端)有 text-right。这是当前版本的 b 表;
<div class="table-responsive mb-0">
<b-table
:items="tableData"
:fields="displayColumn"
responsive="sm"
:per-page="perPage"
:current-page="currentPage"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:filter="filter"
:filter-included-fields="filterOn"
@filtered="onFiltered"
hover
>
<template #cell(detail)="row">
<button @click="toggleRightBar(); changeRightBarContent(row.index)" class="btn btn-outline-primary toggle-right">
<i class="bx bx-detail toggle-right"></i>
</button>
</template>
</b-table>
有没有办法将类添加到特定的列或行?提前致谢。
【问题讨论】:
标签: vue.js bootstrap-vue