A lightweight CSS library for for adding transitions to Vue components ⭐
Installation via NPM:
npm install vue-transitions-css
In the main.js
file:
...
import 'vue-transitions-css';
...
This imports the minified css distribution file globally, available for use anywhere in the project.
In any .vue
file:
<transition name="fade">
<Content v-if="show" />
</transition>
After creating a fork and cloning locally:
- Install dependencies in the root(
/
) directory with:npm install
- Install dependencies in the
/demo
directory withcd demo && npm install
- Open two terminal tabs, In the first run:
npm run watch
and in the second run:npm run develop
- Edit/Create the css files in
/src
folder in the root dir to add new classes. - Open the
/demo/src/assets/animations.js
file and add details about the newly added animation. eg:
// in /demo/src/assets/animations.js
export default [
...
{
name: 'Fade', // the title of the animation to display on the demo page
class: 'fade', // the value that will set to the name prop of the transition wrapper
}
...
]