我正在尝试在我的 firebase 集合中收集一些信息并添加到 mui 数据表中。我怎样才能在我的表中动态地添加这些信息?
let info = {
name: 'Leonard',
age: 23,
city: 'TESTE',
state: 'TS',
e_mail: 'teste@teste.com'
}
//function that reads the infos in my firebase
ReadFromDb(doc => info.ciy = doc.data().City)
let counter = 0;
function createData(name, age, city, state, mail) {
counter += 1;
return { id: counter, name, age, city, state, mail};
}
let data = [
createData(info.name, info.age, info.city, info.state, info.e_mail),
];
我希望在 ReadFromDb 函数运行后可以更改数据。