Releases: axios-use/axios-use-vue
Releases · axios-use/axios-use-vue
0.2.5
Bug Fixes
- useRequest: revert hasPending recomputed (sources) (d349846)
Features
- types:
FullRefArrayItem
compatible with MaybeRef (8082b72)
0.2.4
Bug Fixes
- useRequest: cancel-sources comparison failed (vue reactivity in depth) (6e60503)
0.2.3
Bug Fixes
- types: type directory error (eaeba42)
0.2.2
Feature
- build: add umd modules and
type: module
(b198da0)
0.2.1
Features
- types:
any
replaces unknown
as the response type when using js (d23653c)
0.2.0
Bug Fixes
- type:
onCompleted
response generic error (3c7e56f)
Features
-
request: export _request
function to custom data or response type (4ad4896, ec40987)
-
options: getResponseItem
options (custom data value) (#1)
const [reqState] = useResource(() => _request<MyResponse<UserList>>({ url: `/users` }));
0.1.1
Bug Fixes
- context: support vue 2 (provide) (7013478)
Features
- content: provide_key to Symbol (23c9c32)
- types: support vue2 type (3d22979)
0.1.0
A Vue composition utilities for Axios. Lightweight, cancelable and less change.
Quick Start
<script setup>
import { defineProps, toRef } from "vue";
import { useResource } from "@axios-use/vue";
const props = defineProps(["userId"]);
const userId = toRef(props, "userId");
const [reqState] = useResource((id) => ({ url: `/user/${id}` }), [userId]);
</script>
<template>
<div v-if="reqState.error">{{ reqState.error?.message || "error" }}</div>
<div v-else-if="reqState.isLoading === false">{{ reqState.data?.name }}</div>
<div v-else>...</div>
</template>
import { useRequest, useResource } from "@axios-use/vue";