Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda