feat: #7136 clean code
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
2361042fac
commit
2485ab755d
|
@ -165,10 +165,7 @@ async function fetchFilter(val) {
|
||||||
|
|
||||||
async function filterHandler(val, update) {
|
async function filterHandler(val, update) {
|
||||||
if (!$props.defaultFilter) return update();
|
if (!$props.defaultFilter) return update();
|
||||||
let newOptions;
|
const newOptions = filter(val, myOptionsOriginal.value);
|
||||||
if ($props.url && !isLoading.value) {
|
|
||||||
return;
|
|
||||||
} else newOptions = filter(val, myOptionsOriginal.value);
|
|
||||||
update(
|
update(
|
||||||
() => {
|
() => {
|
||||||
myOptions.value = newOptions;
|
myOptions.value = newOptions;
|
||||||
|
@ -191,11 +188,9 @@ async function onScroll(scrollEv) {
|
||||||
if (direction === 'decrease') return;
|
if (direction === 'decrease') return;
|
||||||
if (to === lastIndex && arrayData.store.hasMoreData && !isLoading.value) {
|
if (to === lastIndex && arrayData.store.hasMoreData && !isLoading.value) {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
!$props.url && (await $props.fetchRef.paginate());
|
await arrayData.loadMore();
|
||||||
$props.url && (await arrayData.loadMore());
|
|
||||||
setOptions(arrayData.store.data);
|
setOptions(arrayData.store.data);
|
||||||
vnSelectRef.value.scrollTo(lastIndex);
|
vnSelectRef.value.scrollTo(lastIndex);
|
||||||
|
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue