【问题标题】:Vuetify External pagination in Data table with CRUD Actions使用 CRUD 操作在数据表中进行 Vuetify 外部分页
【发布时间】:2020-01-15 03:12:03
【问题描述】:

我正在尝试使用CRUD Actions 在数据表中添加here 之类的分页,但表后我什么都没有。 我该如何解决这个问题?

Here is the image what i get

<template>
    <v-data-table
    :headers="headers"
    :items="desserts"
    :page.sync="page"
    :items-per-page="itemsPerPage"
    hide-default-footer
    class="elevation-1"
    @page-count="pageCount = $event"
  >
    <template v-slot:item.action="{ item }">
      <v-icon
        small
        class="mr-2"
        @click="editItem(item)"
      >
        mdi-pencil
      </v-icon>
      <v-icon
        small
        @click="deleteItem(item)"
      >
        mdi-delete
      </v-icon>
    </template>
    <div class="text-center pt-2">
      <v-pagination v-model="page" :length="pageCount"></v-pagination>
    </div>
  </v-data-table>
</template>

【问题讨论】:

  • 我相信您使用了错误的属性名称 - 不应该是 :pagination.sync 吗?我认为没有属性 items-per-page - 它应该是您将为 :pagination.sync 提供的对象的一部分
  • @IVOGELOV 我试图改变它,现在我拥有了我的数据列表中的所有项目,所以每页项目工作,因为我把它算作 3,你可以在图片中看到我有 3 件物品。

标签: vue.js vuetify.js


【解决方案1】:

我找到了答案here 我的错误是我没有像文档中那样提供属性 Pages

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-21
    • 1970-01-01
    • 2019-08-12
    • 1970-01-01
    • 1970-01-01
    • 2021-11-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多