TreeTable: Slot for custom column header in 2.x (#2942)
* Added slot for custom header * Updated treetable doc --------- Co-authored-by: Kirill Uryvaev <kirill.u@nsysgroup.com>pull/4587/head
parent
5c727bb7a7
commit
1598c11055
|
@ -2,6 +2,7 @@
|
|||
<th :style="containerStyle" :class="containerClass" @click="onClick" @keydown="onKeyDown"
|
||||
:tabindex="columnProp('sortable') ? '0' : null" :aria-sort="ariaSort">
|
||||
<span class="p-column-resizer" @mousedown="onResizeStart" v-if="resizableColumns && !columnProp('frozen')"></span>
|
||||
<TTColumnSlot :column="column" type="header" v-if="column.$scopedSlots.header"/>
|
||||
<TTColumnSlot :column="column" v-if="column.children && column.children.header" />
|
||||
<span class="p-column-title" v-if="columnProp('header')">{{columnProp('header')}}</span>
|
||||
<span v-if="columnProp('sortable')" :class="sortableColumnIcon"></span>
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
<Column field="size" header="Size"></Column>
|
||||
<Column field="type" header="Type"></Column>
|
||||
<Column :headerStyle="{'width': '10rem'}" headerClass="text-center" bodyClass="text-center">
|
||||
<template #header>
|
||||
<Button type="button" icon="pi pi-cog"></Button>
|
||||
</template>
|
||||
<template #body>
|
||||
<Button type="button" icon="pi pi-search" class="p-button-success" style="margin-right: .5em"></Button>
|
||||
<Button type="button" icon="pi pi-pencil" class="p-button-warning"></Button>
|
||||
|
@ -44,6 +47,9 @@
|
|||
<Column field="size" header="Size"></Column>
|
||||
<Column field="type" header="Type"></Column>
|
||||
<Column headerStyle="width: 8em" bodyStyle="text-align: center">
|
||||
<template #header>
|
||||
<Button type="button" icon="pi pi-cog"></Button>
|
||||
</template>
|
||||
<template #body="slotProps">
|
||||
<Button type="button" icon="pi pi-search" class="p-button-success" style="margin-right: .5em"></Button>
|
||||
<Button type="button" icon="pi pi-pencil" class="p-button-warning"></Button>
|
||||
|
|
Loading…
Reference in New Issue