mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
chore: request ref to shallowRef
This commit is contained in:
parent
d2fafa9764
commit
6beea0ca95
@ -1,5 +1,5 @@
|
|||||||
import { ApplyPluginsType, plugin } from '@fesjs/fes';
|
import { ApplyPluginsType, plugin } from '@fesjs/fes';
|
||||||
import { ref } from 'vue';
|
import { ref, shallowRef } from 'vue';
|
||||||
|
|
||||||
import { createRequest } from '@qlin/request';
|
import { createRequest } from '@qlin/request';
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ function isPromiseLike(obj) {
|
|||||||
export const useRequest = (url, data, options = {}) => {
|
export const useRequest = (url, data, options = {}) => {
|
||||||
const loadingRef = ref(true);
|
const loadingRef = ref(true);
|
||||||
const errorRef = ref(null);
|
const errorRef = ref(null);
|
||||||
const dataRef = ref(null);
|
const dataRef = shallowRef(null);
|
||||||
let promise;
|
let promise;
|
||||||
if (isPromiseLike(url)) {
|
if (isPromiseLike(url)) {
|
||||||
promise = url;
|
promise = url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user