📜  axios react - Javascript 代码示例

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

代码示例5
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);
        }
      });