我有一个v-data-table的问题,它似乎不能更新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可能的问题是什么?
谢谢你的帮助!
发布于 2019-08-23 16:02:50
所以,移除:search="search"似乎解决了这个问题。https://github.com/vuetifyjs/vuetify/issues/3978
https://stackoverflow.com/questions/57621474
复制相似问题