vue.js ag-grid:如何更改鼠标悬停行背景颜色?

时间:2019-07-04 14:40:59

标签: javascript css typescript vue.js ag-grid

我在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";
            }
        };
    }
}

enter image description here

0 个答案:

没有答案