【发布时间】:2019-08-23 07:15:59
【问题描述】:
我有一个 v-data-table 的问题,它似乎没有更新数据表中元素的总数(分页):
this.$http.post('Ajax/get_rows',
{
search:self.search,
rows_per_page:self.pagination.rowsPerPage,
current_page:self.pagination.page
})
.then(function(response)
{
self.files = response.data.files.data;
self.pagination.totalItems = response.data.files.total;
self.total = response.data.files.total;
console.log(self.pagination);
console.log(response.data.files.total);
console.log(response.data.files);
},
function(error)
{
self.dialog_header = error.body.header;
self.dialog_message = error.body.message;
self.display_dialog = true;
})
.then(function ()
{
});
HTML:
<v-data-table :headers="file_headers" :items="files"
:search="search" class="elevation-1"
:custom-sort="dateSort"
:total-items="total"
rows-per-page-text="Rows per page"
:pagination.sync="pagination">
在对象声明中totalt设置为0。
服务器的响应是:
current_page: 1
from: 1
last_page: 155
per_page: 25
prev_page_url: null
to: 25
total: 3870
所以总数看起来是正确的,但没有在 v-data-table 中更新。它只显示一个“-”号。
分页对象似乎设置正确:
descending: false
page: 1
rowsPerPage: 5
sortBy: "date"
totalItems: 3870
可能是什么问题?
感谢您的帮助!
【问题讨论】:
-
你使用什么 vuetify 版本?
-
@ßiansorÅ.Ålmerol 我使用的是 1.5.5 版
标签: vue.js vuetify.js