项目更改时将当前页面保留在 vuetify 中
keep current page in vuetify when items change
如何在vuetify
的数据表中改变项目时保持当前页。
当前页为2,向items添加新项如何保持当前页为2
在向数据添加项目之前table,您可以保存当前页码并在成功添加项目后重新使用它。
演示:https://codepen.io/jacobgoh101/pen/odmEER?editors=0011
showFullMats (item) {
// store current page number first
this.prevPage = this.pagination.page;
// codes for adding items...
// reset to page number before adding item
this.$nextTick().then(()=>{
this.$set(this.pagination, 'page', this.prevPage);
});
}
如何在vuetify
的数据表中改变项目时保持当前页。
当前页为2,向items添加新项如何保持当前页为2
在向数据添加项目之前table,您可以保存当前页码并在成功添加项目后重新使用它。
演示:https://codepen.io/jacobgoh101/pen/odmEER?editors=0011
showFullMats (item) {
// store current page number first
this.prevPage = this.pagination.page;
// codes for adding items...
// reset to page number before adding item
this.$nextTick().then(()=>{
this.$set(this.pagination, 'page', this.prevPage);
});
}