English | 简体中文
⚡️ Vue 3 composition API for data fetching. This is a version for Vue 2 by using @vue/composition-api, which is forked from VueRequest.
npm install vue2-request-utils
# or with yarn
yarn add vue2-request-utils
import { useRequest } from "vue2-request-utils";
export default {
setup() {
const { data } = useRequest("api/user");
return () => <div>{data.value}</div>;
},
};