需要使用async / await从IndexDb获取所有值 //期望b具有index-db的结果集
var b ="";
var request = window.indexedDB.open("mydb");
request.onsuccess = function (event) {
var db = event.target.result;
var objectStore = db.transaction("mytable").objectStore("mytable");
allRecords = objectStore.getAll();
allRecords.onsuccess= function(event){
console.log(event.target.result)
b = 10;
b = event.target.result
}
console.log(b);
//b is ""
答案 0 :(得分:0)
[[] for _ in range(4)]