IndexedDB 的游标分页 limit 写下代码
时间: 2023-03-13 22:23:20 浏览: 118
var request = window.indexedDB.open(dbName);
request.onsuccess = function(event) {
var db = event.target.result;
var transaction = db.transaction(["tableName"], "readonly");
var objectStore = transaction.objectStore("tableName");
var request = objectStore.openCursor(null, 'next');
request.onsuccess = function(event) {
var cursor = event.target.result;
if (cursor) {
// 在此处设置游标分页 limit
cursor.advance(10);
}
}
};
阅读全文