/vue-request

⚡️ A request library for Vue 3. 一个能轻松帮你管理请求状态的 Vue 3 请求库。欢迎使用~

Primary LanguageTypeScriptMIT LicenseMIT

English | 简体中文

VueRequest logo

VueRequest

⚡️ A request library for Vue 3.

Coverage Status Size Version Languages License

Status: Beta

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@beta

# or with yarn
yarn add vue-request@beta

CDN

<script src="https://unpkg.com/vue-request@beta"></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
  • Support Vue 2

Thanks

Thank them for inspiring us.

Thanks to xiadd for providing the awesome vue-request npm package name!

License

MIT License © 2020-present AttoJS