V
V
VegasChickiChicki2019-06-14 06:46:50
Vue.js
VegasChickiChicki, 2019-06-14 06:46:50

How to make a smooth transition between the elements of the displayed list?

I read the documentation, did everything as it is written, there is a moment that says that you need to hang the key, I hung it, but it still doesn’t work (
Moreover, it’s very strange that the transition tag props are empty, although the class is registered (attached a photo)
5d0317e3919ca763795104.png
Here is the code:

<transition name="fade" mode="out-in">
            <div class="project"
                 v-for="(project,index) in projects"
                 v-if="projectIndex === index"
                 key="index">
            </div>
 </transition>

Can't figure out what I'm missing?
Here is the css style code (Sass):
.fade-enter-active, .fade-leave-active
  transition: opacity .5s

.fade-enter, .fade-leave-to
  opacity: 0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2019-06-14
@VegasChickiChicki

:key=index
In general, it is desirable to come up with something to make the key more unique.
The answer is missing a colon before key.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question