use-http-vue
v0.0.1
Published
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Readme
use-http-vue
A Vue 3 composition API for making HTTP requests.
It is just a design idea, no implement. Don't use it now.
Note: This is a work in progress and is not yet ready for use. Pull requests are welcome.
Install
npm install use-http-vueUsage
Basic Usage
import { useHttp } from 'use-http-vue';
// make a get request
const [data, loading, sendHttp, error] = useHttp('https://jsonplaceholder.typicode.com/posts');
// make a post request
const [data, loading, sendHttp, error] = useHttp.post('https://jsonplaceholder.typicode.com/posts',{title:'foo',body:'bar',userId:1});
// other methods
// useHttp.put,useHttp.delete,useHttp.head etc