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 { onMounted } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import FetchData from 'src/components/FetchData.vue'; 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({ const $props = defineProps({
modelValue: { modelValue: {
@ -163,7 +163,7 @@ async function onScroll({ to, ref }) {
console.log(lastIndex, to); console.log(lastIndex, to);
if (optionIndex > 0 && to === lastIndex) { if (optionIndex > 0 && to === lastIndex) {
loading.value === false && emit('Paginate'); loading.value === false && emit('onPaginate');
loading.value = true; loading.value = true;
} }
} }

View File

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