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

247
Visualizações
SSR and keep-alive issue in Vue 3: dynamic component
<template>
      <div class="default-layout">
          <router-view v-slot="{ index }">
            <keep-alive>
              <component :is="index" :key="route.fullPath" />
            </keep-alive>
          </router-view> 
      </div>
</template>
    
<script lang="ts">
    import { defineComponent} from "vue";
    import { useRoute } from "vue-router";
    import Index from "@/pages/index";
    
    export default defineComponent({
      name: "app",
      components: {
        Index,
      },
      setup: () => {
        const route = useRoute();
       
        return { route, index: Index };
      },
    });

</script>

It will lead to an error while rendering: Error message

[Vue warn]: Hydration node mismatch:
- Client vnode: Symbol(Comment) 
- Server rendered DOM: <!--[--> (start of fragment) 
  at <KeepAlive> 
  at <RouterView key=0 > 
  at <App>

Hydration children mismatch in <div>: server rendered element contains fewer child nodes than client vdom. 

Hydration completed but contains mismatches.

What shall I do to fix this issue?

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

0

I believe this is a bug. You can follow it at https://github.com/vuejs/vue-next/issues/4817

At the time of this writing, it was not yet confirmed by Vue maintainers.

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