rowStyle
Description
Optional. Defines the style of a row in the tableUsage
rowStyle?: (row: any) => string;
Parameters
The function takes the following parameters:
row- an object with the row configuration, where key is the row ID:
{
[key: string]: any;
}
The function returns the name of a CSS class or an empty string.
Example
<script setup>
import { getData } from "./common/data";
import { Grid } from "@svar-ui/vue-grid";
const { data, columns } = getData();
</script>
<template>
<Grid
:data="data"
:columns="columns"
:rowStyle="row => (row.id == 11 ? 'rowStyle' : '')"
/>
</template>
<style scoped>
:global(.rowStyle:not(.selected) .cell) {
color: white;
background: #0ebf6c;
}
</style>