[Vuejs]-Vue.js add class for fade in with v-if

0👍

I’m pretty sure the issue is that the html tag (<a> in this case), needs to first be added to the DOM (ie v-if = true), then you need to add the css class on that element which triggers the fading in.

You are causing both to happen at the same time (Inserting into DOM with a fadeIn class) and that will short-circuit the transition effect and just show it as visible.

Using vue’s transition facilities (as @MatheusValenza pointed out in the comment) is one way to have the css class applied seperately after the DOM insertion.

👤RonC

Leave a comment