idb-js
idb-js copied to clipboard
对indexdb本地数据库的封装
简单场景:调用登录接口,将token存入indexDB,存储成功后,在封装的idb的success回调中是否能支持$router跳转,之前我使用过为封装的indexDB,在类似场景中,存储成功后不能跳转业务场景。
在本地测试了下10000条数据查询耗时8-9s左右。 而通过indexedDB的store.getAll(),拿出数据后在内存里for循环判断条件。耗时1s左右 demo代码如下:  遍历游标的方式应该是不可取的。
/** * @method 删除数据 * @param {Object} * @property {String} tableName 表名 * @property {Function} condition 查询的条件,遍历,与filter类似 * @arg {Object} 每个元素 * @return 条件 * @property {Function} [success] 删除成功的回调 @return...
如何实现分页