vue.js - keep current page in vuetify when items change
问题描述
How to keep the current page in data tables in vuetify
when the items is changed.
the current page is 2, add new item to items how to keep the current page 2
解决方案
在向数据表添加条目之前,可以保存当前页码,添加条目成功后重新使用。
演示: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);
});
}
推荐阅读
- glob - Glob 忽略节点测试文件
- javascript - 映射对象,转换为数组,然后转换回对象
- java - 用空字段改造获取对象
- excel - VSTO Excel 加载项自动禁用
- html - 如何在 CSS 中用视频源替换图像源
- ms-access - 在访问中仅使用默认值创建一行
- android - 如何在flutter插件中使用本地aar?
- openssl - OpenSSL 和 BouncyCastle 之间的 ECDSA 密钥大小差异
- c++ - 如何将信号处理程序添加为方法
- google-cloud-platform - Cloud SQL PostgreSQL 是否有可用的逻辑解码插件?