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

232
Visualizações
Fetch hook and NuxtLoading component

I have a question about migration from asyncData pattern to fecth in Nuxt App. It seems straightforward, except for 1 thing - i can't get NuxtLoading component to act right. I've tried to watch for $fetchState and start loading with this.$nuxt.$loading.start(), but it's no use. The loading indicator flashes for mere second and disappears without any input on my part. Is there a trick to make it work like it does with asyncData?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The whole point of using fetch() is to not block the render in between pages. The loader is here to let the user know when he will be able to expect the next page.

When you're using fetch(), you can use $fetchState.pending to make a conditional and display either a loader or a skeleton like this: https://buefy.org/documentation/skeleton/

The loading bar should still be triggered but it will probably be smoother (and maybe shorter visually), I'd recommend to let it live it's life.

over 4 years ago · Santiago Trujillo Relatório
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