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

119
Visualizações
How to avoid having django template display before VueJS render

I have a Django template that I'm trying to render with VueJs using CDN. The problem is when the page is loaded, i see the raw code of Django with the delimiters before it get rendered with VueJS. It takes less that a sec.

I have an API call (using Fetch) that retrieve some data before displaying them and I put that in mounted() function. The delay is almost 0.6sec and we can see Django render before vuejs render the page.

Then I change mounted() to beforeMount(). I now see the Django render from time to time but it's much better because often, vue render comes first.

Is there a better way to solve this? I'm using CDN, and I didn't want to get into server-side rendering for this project.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The directive v-cloak solve it.

<div id="#app">
    <div v-cloak>
       [[ message ]]  // Vue delimiters for django.
    </div>
</div>

with the style

[v-cloak] {
  display: none;
}

Juste make sure to add the directive inside of the main #app div

More to it here Hiding vue.js template before it is rendered

about 4 years ago · Juan Pablo Isaza 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