是否可以在 Vuetify 数据表中创建多行标题?

Ste*_*993 4 vue.js vuetify.js

我想创建一个带有多行标题的表,如本例所示。

我找到了这篇文章,但答案不起作用。此外,我查看了Vuetify文档和Github问题,但似乎没有解决方案。

如果有人能让我知道这样的事情是否可能以及如何实现,那就太好了。

nik*_*apa 6

事实证明,如果您只添加<thead>槽模板,您可以简单地在默认标题上方实现您自己的类别行。省略将<thead>其放在下面。

<v-data-table ...>
  <template v-slot:header="props" >
    <thead>
      <tr>
        <th colspan="2">Category 1</th>
        <th colspan="3">Category 2</th>
      </tr>
    </thead>
  </template>
</v-data-table>
Run Code Online (Sandbox Code Playgroud)