gtiger666 / vue-request

⚡️ Vue 3 composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc. ⚡️ 一个能轻松帮你管理请求状态(支持SWR,轮询,错误重试,缓存,分页等)的 Vue 3 请求库

Home Page:https://www.attojs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

English | 简体中文

VueRequest logo

VueRequest

⚡️ Vue 3 composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc.

Coverage Status Size Version Languages License Star Download

Features

  • 🚀 All data is reactive
  • 🔄 Interval polling
  • 🤖 Automatic error retry
  • 🗄 Built-in cache
  • 📠 Written in TypeScript
  • 🍃 Lightweight
  • 📦 Out of the box
  • 🔥 Interactive docs

Documentation

Install

npm install vue-request

# or with yarn
yarn add vue-request

CDN

<script src="https://unpkg.com/vue-request"></script>

It will be exposed to global as window.VueRequest.useRequest

Usage

import { useRequest } from 'vue-request';

export default {
  setup() {
    const { data } = useRequest('api/user');
    return () => <div>{data.value}</div>;
  },
};

TODO List

If you have any cool features, please submit an issue for discussion

  • Documentation
  • Pagination
  • Load More

Thanks

Thank them for inspiring us.

License

MIT License © 2020-present AttoJS

About

⚡️ Vue 3 composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc. ⚡️ 一个能轻松帮你管理请求状态(支持SWR,轮询,错误重试,缓存,分页等)的 Vue 3 请求库

https://www.attojs.org

License:MIT License


Languages

Language:TypeScript 97.7%Language:JavaScript 2.1%Language:HTML 0.2%