Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
Cómo identificar cuándo el v-autocompletar de Vuetify alcanza el último elemento desplazado

Tengo un Vuetify v-autocompletar que quiero saber cuándo el usuario se desplazó hasta su último elemento, para poder cargar más elementos (sin que tenga que escribir para buscar):

 // component.vue <template> <v-autocomplete ref="myAutocomplete" v-model="selectedItem" autocomplete="off" :items="items" no-filter :label="$t('unit')" rounded outlined item-text="name" return-object /> </template>

No veo ningún accesorio o evento disponible que pueda ayudarme a hacer eso.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Mi solución fue escuchar eventos de desplazamiento en el elemento v-menu__content de v-menu__content :

 // component.vue export default { ..., // at mounted hook we set the listener mounted() { const component = this.$refs.myAutocomplete; component.onScroll = this.onScroll(component); }, // and our method should look like: methods: { onScroll(component) { // recursively will search for the specified child const findChildren = (elem, name) => { if (elem.$el.className.includes(name)) return elem.$el; let i = 0; let children; for (i; !children && i < elem.$children.length; i++) { children = findChildren(elem.$children[i], name); } return children; } // searchs for 'v-menu--content' element inside v-autocomplete const vMenuContent = findChildren(component, 'v-menu__content'); // take its scroll values const a = vMenuContent.scrollTop; const b = vMenuContent.scrollHeight; const c = vMenuContent.clientHeight; // check if it is 100% scrolled const isScrolled = (a / (b - c)) === 1; if (!isScrolled) return // reached the last item: load more items... }, },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!