vue-animated-list
A Vue.js plugin for easily animating v-for
rendered lists.
Compatibility: IE10+.
Installation
-
#### With Modules
// ES6Vue// ES5var Vue =Vue -
####
<script>
IncludeJust include
vue-animated-list.js
after Vue itself.
Usage
There's nothing you need to do in JavaScript except for installation. In your markup, make sure the v-for
has a transition attribute:
{{ item.text }}
Now, all you need to do is define the .item-move
CSS class:
And that's it! You can also add CSS classes for enter and leave transitions - they all work nicely together!
A few things to note:
-
The animation is done using the CSS
transform
property. So make sure when.item-move
is applied itstransform
property is transition-enabled. -
Move animations can only work on elements, so it doesn't work for
<template v-for>
and fragment instance components.