javascript - 如何重命名 vuetify 数据表组标签?

标签 javascript vue.js datatables vuetify.js grouping

我想更改 vuetify 数据表的组标签。对于下面的 Vuetify 早期版本,代码工作正常,但现在不起作用。

<va-data-table-server
  :items-per-page="50"
  :group-by="groupBy"
  row-create
  row-clone
  row-edit
  disable-edit
  disable-show
  disable-clone
  disable-create-redirect
>
  <template v-slot:column.data-table-group>
  </template>
</va-data-table-server>

How can i rename vuetify data-table group label

这是演示链接。

https://play.vuetifyjs.com/#eNq9lt9vmzAQx

最佳答案

使用header插槽

You can use the dynamic slots header.<key> to customize only certain columns. <key> corresponds to the key property in the items found in the headers prop.

“Group” header 的键是 data-table-group (通过首先使用 headers 插槽并将所有列数据打印到 UI: seen here 找到),因此您需要使用的实际插槽是 header.data-table-group

<template v-slot:header.data-table-group>
  <div>custom</div>
</template>

Vuetify Playground

关于javascript - 如何重命名 vuetify 数据表组标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77543977/

相关文章:

javascript - 混合静态/动态谷歌地图

javascript - 为什么 Vue.js 使用 VDOM?

javascript - dataTable fn用新值更新行

javascript - document.write 多行文本

javascript - 无法使用 Restangular 获取快速删除中的 json 请求?

javascript - 即使不满足条件, $(window).scroll 也会在 if 语句内执行

forms - Axios POST 请求 (VueJS) 上的跨源请求被阻止

javascript - vue.js - 如何将对象数组拆分为多个 div 列

javascript - 表格行文本突出显示弹出窗口(仅)我

javascript - 使用 ReactJS 时数据表 Bootstrap 主题不适用