refs #7136 perf: handle when fetchRef not exists
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-03-26 06:27:22 +01:00
parent 9b355f8ef6
commit 24483448dc
2 changed files with 3 additions and 2 deletions

View File

@ -165,7 +165,7 @@ async function onScroll(scrollEv) {
const lastIndex = myOptions.value.length - 1;
const optionIndex = ref.getOptionIndex();
console.log(lastIndex, to, optionIndex);
if (!$props.fetchRef) return;
if (direction === 'decrease') return;
if (optionIndex > 0 && to === lastIndex && isLoading.value === false) {
isLoading.value = true;

View File

@ -28,6 +28,7 @@ const suppliersRef = ref();
:filter="{ fields: ['id', 'nickname'] }"
order="nickname"
limit="30"
auto-load
@on-fetch="(data) => (suppliers = data)"
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
@ -86,10 +87,10 @@ const suppliersRef = ref();
:options="suppliers"
option-value="id"
option-label="nickname"
@input-value="suppliersRef.fetch()"
dense
outlined
rounded
:fetch-ref="suppliersRef"
>
</VnSelectFilter>
</QItemSection>