📜  npm i axios - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:10.948000             🧑  作者: Mango

代码示例3
let params = {
      page: currentPage + 1,
      per_page: rowsPerPage
    }
    axios
      .get('/products', { params: params })
      .then((response) => {
        if (isMountedRef.current) {
          setProducts(response.data.data);
          setMeta(response.data.meta);
        }
      });