This commit is contained in:
@ -16,7 +16,17 @@ function parser() {
|
|||||||
return j();
|
return j();
|
||||||
}
|
}
|
||||||
logger('食谱加载成功');
|
logger('食谱加载成功');
|
||||||
recipeData = data;
|
const keys = data.shift()
|
||||||
|
console.log(keys)
|
||||||
|
recipeData = data.map(d => {
|
||||||
|
const res = {}
|
||||||
|
keys.forEach((key, index) => {
|
||||||
|
if (key) {
|
||||||
|
res[key] = d[index]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return res
|
||||||
|
});
|
||||||
loaded = true;
|
loaded = true;
|
||||||
r(recipeData);
|
r(recipeData);
|
||||||
});
|
});
|
||||||
@ -31,3 +41,7 @@ export default async function getDb() {
|
|||||||
return recipeData;
|
return recipeData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDb().then((res) => {
|
||||||
|
console.log(recipeData)
|
||||||
|
})
|
||||||
|
Reference in New Issue
Block a user