首页 > 解决方案 > 为什么发射器@current-items 不适用于 v-data-table?

问题描述

我想控制台记录表中的可见项目,但@current-items 发射器不起作用,请帮我找出原因? 我有 Vuetify:“1.3.11”

methods: {
        currentItems(val) {
           console.log(val) // the method is not called for some reason
            this.test = val
           console.log(this.test)
        }
}
        <v-data-table
            @input="updateSelected"
            v-bind="calculatedTableProps"
            ref="dataTable"
            :pagination.sync="localPagination"
            :value="selected"
            :headers="localHeaders"
            :items="filteredItems"
            :headers-length="headerCount"
            :total-items="totalCount"
            :loading="tableLoading"
            class="big-data-table"
            :class="tableFitContent ? 'table-fit-content' : ''"
            :hide-actions="customActions"
            v-scroll:[scrollTarget]="onScroll"
            @current-items="currentItems"
        >

标签: javascriptvue.jsvuetify.js

解决方案


@current-itemsVuetify 1.x 中似乎不存在该事件。查看Vuetify 1.5.24的 v-data-table文档。


推荐阅读