Answer the question
In order to leave comments, you need to log in
How to animate removal from reactive DOM in VUE?
Hello! Tell me such a thing.
There is a reactive DOM:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
Answer the question
In order to leave comments, you need to log in
Replace ol
with transition-group
:
<transition-group tag="ol" name="todo">
<li
v-for="(todo, i) in todos"
:key="todo.id"
@click="todos.splice(i, 1)"
>{{ todo.text }}</li>
</transition-group>
li {
transition: all 0.7s;
}
.todo-leave-active {
position: absolute;
}
.todo-leave-to {
transform: translateX(500px);
opacity: 0;
}
This is how it is also transferred https://jsfiddle.net/jk8tm7yw/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question