我在vue.js中使用ag-grid,并且我想更改鼠标悬停时的背景颜色。
我该怎么做?
目前,这就是我所拥有的:
<template>
<ag-grid-vue
class="ag-theme-material gray-border"
domLayout="autoHeight"
:gridOptions="gridOptions"
></ag-grid-vue>
</template>
<style>
.ag-row .ag-cell {
display: flex;
align-items: center;
}
.white-bg {
background-color: #ffffff;
}
.light-bg {
background-color: #fefefe;
}
.gray-border {
border-color: lightgray;
border-width: 1px;
border-style: solid;
}
</style>
export default class CashoutRecords extends Vue {
gridOptions: GridOptions = {
rowHeight: 45,
};
mounted() {
this.gridOptions.getRowClass = (params: any) => {
if (params.node.rowIndex % 2 === 0) {
return "white-bg";
} else {
return "light-bg";
}
};
}
}