Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
Vue js infinite scroll(treeselect)

I'm trying to implement infinite scroll in vue js via treeselect. I've tried to do it like so - https://github.com/riophae/vue-treeselect/issues/275 It seemed to work for them, however, I'm getting this error:

[Vue warn]: Error in nextTick: "TypeError: _this.$refs.tree.getMenu is not a function"

Error screenshot

Here is the code

Template:

  <div class="invite_form--item">
       <treeselect ref="tree" :options="infiniteOptions" @open="handleMenuOpen" />
  </div>

Script:

      methods:{
        handleMenuOpen() {
            this.$nextTick(() => {
                for(const item of this.$refs.tree){
                    console.log(item)
                }
                const menu = this.$refs.tree.getMenu()
                const hasReachedEnd = menu.scrollHeight - menu.scrollTop <= menu.clientHeight * 1.25
                menu.addEventListener('scroll', () => {
                if (hasReachedEnd) this.fetchOptions()
                })
            })
        },
    
        
    fetchOptions() {
        if (this.isFetchingOptions) return
        this.isFetchingOptions = true
    
        xhr().then(newOptions => {
        this.options.push(...newOptions)
        this.isFetchingOptions = false
        })
    },
}

If anyone has any clue regarding this error, I'd really appreciate your help :)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda