diff --git a/packages/integrations/useAxios/index.ts b/packages/integrations/useAxios/index.ts index 4fd5fb24852..506948d325e 100644 --- a/packages/integrations/useAxios/index.ts +++ b/packages/integrations/useAxios/index.ts @@ -1,4 +1,4 @@ -import { Ref, ref } from 'vue-demi' +import { Ref, ref, shallowRef } from 'vue-demi' import axios, { AxiosError, AxiosRequestConfig, AxiosResponse, CancelTokenSource, AxiosInstance } from 'axios' export interface UseAxiosReturn { @@ -42,12 +42,12 @@ export function useAxios(url: string, ...args: any[]) { instance = args[1] } - const response = ref(null) as Ref | undefined> - const data = ref(undefined) as Ref + const response = shallowRef>() + const data = shallowRef() const finished = ref(false) const loading = ref(true) const canceled = ref(false) - const error = ref | undefined>() + const error = shallowRef>() const cancelToken: CancelTokenSource = axios.CancelToken.source() const cancel = (message?: string) => {