const [list, setList] = useState([]); class Person { async handleList(data: () => any, record: any) { await data().then((res: any) => { record(res.data); }); } } const person = new Person(); useEffect(() => { person.handleList(getSwiper, setList); }, []);
标签:const,any,setList,record,data,class From: https://www.cnblogs.com/zjxzhj/p/17357390.html