【发布时间】:2021-11-12 17:36:16
【问题描述】:
我在 ReactJs 中有一个代码,它只是一个 SELECT。该请求工作正常,但我想将其结果保存到一个变量(或类似的东西)中。我该怎么做?
const data;
async function selecionaSubsistemas() {
return Axios.post("http://localhost:3001/api/selecionaSubsistemas", {
}).then((response)=>{
});
}
const getData = async() => {
data = await selecionaSubsistemas();
};
console.log(data);
【问题讨论】: