Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!