fix: refs #6464 fix error isLoading
This commit is contained in:
parent
4b2d977542
commit
20ae555e14
|
@ -84,20 +84,23 @@ watch(
|
||||||
|
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
async function search() {
|
async function search() {
|
||||||
store.filter.where = {};
|
try {
|
||||||
isLoading.value = true;
|
store.filter.where = {};
|
||||||
const params = { ...userParams.value };
|
isLoading.value = true;
|
||||||
store.userParamsChanged = true;
|
const params = { ...userParams.value };
|
||||||
store.filter.skip = 0;
|
store.userParamsChanged = true;
|
||||||
store.skip = 0;
|
store.filter.skip = 0;
|
||||||
const { params: newParams } = await arrayData.addFilter({ params });
|
store.skip = 0;
|
||||||
userParams.value = newParams;
|
const { params: newParams } = await arrayData.addFilter({ params });
|
||||||
|
userParams.value = newParams;
|
||||||
|
|
||||||
if (!props.showAll && !Object.values(params).length) store.data = [];
|
if (!props.showAll && !Object.values(params).length) store.data = [];
|
||||||
|
|
||||||
isLoading.value = false;
|
emit('search');
|
||||||
emit('search');
|
if (props.redirect) navigate(store.data, {});
|
||||||
if (props.redirect) navigate(store.data, {});
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reload() {
|
async function reload() {
|
||||||
|
|
Loading…
Reference in New Issue