如何在 ag-grid 中显示行数?

How to display rows count in ag-grid?

如何显示 ag-grid 行的行数?

我尝试挂钩 modelUpdated 事件,但事件未被调用。

我想在页面加载时以及每行更改时显示行数。

 <ag-grid-vue
          style="width: 700px;height: 500px;margin:20px 0;"
          class="ag-theme-balham"
          :enableCellChangeFlash="true"
          ...
          rowHeight="55"
          :modelUpdated="onModelUpdated"
        ></ag-grid-vue>

vue 中,对事件使用 @,而不是 :

此处有效的代码:

<ag-grid-vue
  style="width: 700px;height: 500px;margin:20px 0;"
  class="ag-theme-balham"
  :enableCellChangeFlash="true"
  ...
  rowHeight="55"
  @modelUpdated="onModelUpdated"
></ag-grid-vue>

onModelUpdated(event) {
  const rowsCount = event.api.getDisplayedRowCount();
}