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);
  }, []);

  

posted @ 2023-04-26 21:19  zjxgdq  阅读(13)  评论(0编辑  收藏  举报