refs #7136 pef: replace paginate by onPaginate
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-03-25 11:17:24 +01:00
parent 403d2cc55b
commit 14f2143304
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import { ref, toRefs, computed, watch } from 'vue';
import { onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'src/components/FetchData.vue';
const emit = defineEmits(['update:modelValue', 'update:options', 'Paginate']);
const emit = defineEmits(['update:modelValue', 'update:options', 'onPaginate']);
const $props = defineProps({
modelValue: {
@ -163,7 +163,7 @@ async function onScroll({ to, ref }) {
console.log(lastIndex, to);
if (optionIndex > 0 && to === lastIndex) {
loading.value === false && emit('Paginate');
loading.value === false && emit('onPaginate');
loading.value = true;
}
}

View File

@ -39,6 +39,7 @@ function handleLocation(data, location) {
data.provinceFk = provinceFk;
data.countryFk = countryFk;
}
const businessTypesRef = ref();
</script>
<template>
@ -48,8 +49,10 @@ function handleLocation(data, location) {
url="Workers/search?departmentCodes"
/>
<FetchData
ref="businessTypesRef"
@on-fetch="(data) => (businessTypesOptions = data)"
auto-load
limit="10"
url="BusinessTypes"
/>
<QPage>
@ -84,6 +87,7 @@ function handleLocation(data, location) {
option-label="description"
option-value="code"
v-model="data.businessTypeFk"
@on-paginate="(data) => businessTypesRef.paginate()"
/>
</div>
<div class="col">