This commit is contained in:
@ -16,7 +16,17 @@ function parser() {
|
||||
return j();
|
||||
}
|
||||
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;
|
||||
r(recipeData);
|
||||
});
|
||||
@ -31,3 +41,7 @@ export default async function getDb() {
|
||||
return recipeData;
|
||||
}
|
||||
}
|
||||
|
||||
getDb().then((res) => {
|
||||
console.log(recipeData)
|
||||
})
|
||||
|
Reference in New Issue
Block a user