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

157
Visualizações
Vue - Transitioning the route doesn't work

I'm using vue 3 with vue router, and I used the same code from the docs for transitioning the route, and it worked at first, but after some changes in the code in other files, it decided not to work ;-;

Here is my app.vue

<template>
  <Nav />
  <router-view v-slot="{ Component }">
    <transition name="Fade">
      <div>
        <component :is="Component" />
      </div>
    </transition>
  </router-view>
</template>

<script>
import Nav from "@/components/Nav.vue";

export default {
  name: "HomeView",
  components: {
    Nav,
  },
};
</script>

<style scoped>
.Fade-enter-from,
.Fade-leave-to {
  opacity: 0;
  transform: translateX(120px);
}
.Fade-enter-active,
.Fade-leave-active {
  transition: all 0.5s ease-in;
}
</style>

and here's the Main Route

<template>
  <div>
    <WText />
    <Softwares />
  </div>
</template>

<script>
import WText from "@/components/WText.vue";
import Softwares from "@/components/Softwares.vue";

export default {
  components: {
    WText,
    Softwares,
  },
};
</script>

The other route (contact) is just an empty vue file, nothing special.

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

0

transition tag works when inner content re-renders (which could mean Component variable change, setting v-if="true" to v-if="false" and viceversa.), wrapping <component> tag with div will keep a constant dom element existing. Getting rid of wrapper div (or force rerender when Component variable changes which is not a good way to do it.)

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