Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

Documentation for CSS transitions can be found here.

Pretty sure I set up my JSFiddle exactly how it needs to be set up for the transition to work. Not entirely certain because imo the documentation is a little light on CSS transitions.

Have some very basic HTML/CSS I was hoping would enable Vue.js to create a nice fade effect:

CSS:

.fade-transition {
  opacity: 1;
  transition: all .45s linear;
}

.fade-enter, .fade-leave {
  opacity: 0;
}

HTML:

<div class="loading-overlay" v-if="loading" v-transition="fade">
  In 5 seconds, this overlay should fade out...
</div>  

However, it doesn't seem to be working. Any advice?

JSFiddle

share|improve this question
up vote 2 down vote accepted

For the transition attribute in your div tag, simply remove the v- from before the transition and it'll work.

<div class="loading-overlay" v-if="loading" transition="fade">
  In 5 seconds, this overlay should fade out...
</div>
share|improve this answer
2  
For god's sake... thank you – styke Jul 18 at 13:13

Change v-transition to just transition.

<div class="loading-overlay" v-if="loading" transition="fade">
  In 5 seconds, this overlay should fade out...
</div>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.