functiong mov(){
const [source, setSource] = useState([]);
}
useEffect(() => {
const hide = message.loading('正在加载');
try {
if (id !== '') {
fetchData().then(r => hide());
}
} catch (e) {
hide();
}
}, []);
//读取数据,并且放入一个数组中
function fetchData() {
setSource(async ()=>{
const res = await queryBilling(id);
return res;//这里可以获取值
})
console.log(source,'data') ----这里获取不到source的值?????
//查询接口
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…