Fixed #3738 - DataTable: rowStyle function doesn't work
parent
9a92f3eeb2
commit
50d7ac5782
|
@ -779,7 +779,7 @@ export interface DataTableProps {
|
|||
/**
|
||||
* A function that takes the row data as a parameter and returns the inline style for the corresponding row.
|
||||
*/
|
||||
rowStyle?: any;
|
||||
rowStyle?: (data: any) => object | undefined;
|
||||
/**
|
||||
* When specified, enables horizontal and/or vertical scrolling.
|
||||
* @defaultValue false
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
v-if="expandableRowGroups ? isRowGroupExpanded(rowData) : true"
|
||||
:key="getRowKey(rowData, getRowIndex(index))"
|
||||
:class="getRowClass(rowData)"
|
||||
:style="rowStyle"
|
||||
:style="getRowStyle(rowData)"
|
||||
:tabindex="setRowTabindex(index)"
|
||||
role="row"
|
||||
:aria-selected="selectionMode ? isSelected(rowData) : null"
|
||||
|
@ -282,6 +282,11 @@ export default {
|
|||
|
||||
return getItemOptions ? getItemOptions(index).index : index;
|
||||
},
|
||||
getRowStyle(rowData) {
|
||||
if (this.rowStyle) {
|
||||
return this.rowStyle(rowData);
|
||||
}
|
||||
},
|
||||
getRowClass(rowData) {
|
||||
let rowStyleClass = [];
|
||||
|
||||
|
|
Loading…
Reference in New Issue