Merge pull request #5950 from karpov159/feature-prop-showheaders

Feat(DataTable): added showHeaders prop to datatable
pull/6465/head
Tuğçe Küçükoğlu 2024-09-24 09:07:47 +03:00 committed by GitHub
commit 00186c9798
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -238,6 +238,10 @@ export default {
type: String, type: String,
default: '960px' default: '960px'
}, },
showHeaders: {
type: Boolean,
default: true
},
showGridlines: { showGridlines: {
type: Boolean, type: Boolean,
default: false default: false

View File

@ -1164,6 +1164,11 @@ export interface DataTableProps {
* @defaultValue 960px * @defaultValue 960px
*/ */
breakpoint?: string | undefined; breakpoint?: string | undefined;
/**
* Whether to display table headers
* @defaultValue true
*/
showHeaders?: boolean | undefined;
/** /**
* Whether to show grid lines between cells. * Whether to show grid lines between cells.
* @defaultValue false * @defaultValue false

View File

@ -70,6 +70,7 @@
<template #content="slotProps"> <template #content="slotProps">
<table ref="table" role="table" :class="[cx('table'), tableClass]" :style="[tableStyle, slotProps.spacerStyle]" v-bind="{ ...tableProps, ...ptm('table') }"> <table ref="table" role="table" :class="[cx('table'), tableClass]" :style="[tableStyle, slotProps.spacerStyle]" v-bind="{ ...tableProps, ...ptm('table') }">
<DTTableHeader <DTTableHeader
v-if="showHeaders"
:columnGroup="headerColumnGroup" :columnGroup="headerColumnGroup"
:columns="slotProps.columns" :columns="slotProps.columns"
:rowGroupMode="rowGroupMode" :rowGroupMode="rowGroupMode"