class
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); }, []);
本文来自博客园,作者:zjxgdq,转载请注明原文链接:https://www.cnblogs.com/zjxzhj/p/17357390.html