vue-lottie is a Vue 2 component designed to display Lottie animations, acting as a wrapper for the `bodymovin.js` library (now known as `lottie-web`). The package, currently at version `0.2.1`, was last published approximately eight years ago, indicating it is no longer actively maintained. It primarily supports Vue 2.x applications and leverages the Lottie animation format for creating lightweight, scalable vector animations exported from Adobe After Effects. While it provides basic functionality for playing, pausing, and controlling animation speed, its age means it lacks support for modern Vue 3 applications and the latest features or optimizations of `lottie-web`. Developers seeking Lottie integration in contemporary Vue projects should consider actively maintained alternatives like `vue3-lottie` or `lottie-web-vue` which offer Vue 3 and TypeScript support. The package's key differentiator was its early integration of Lottie with Vue 2, providing a declarative component interface for simple animation playback.
npm install vue-lottieVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and register the Lottie component locally, load animation JSON data, and control playback (play, pause, stop, speed) using component methods.
For Vue 3 projects, use modern alternatives like `vue3-lottie` or `lottie-web-vue`, which are actively maintained and built for Vue 3.
Migrate to actively maintained Lottie component libraries for Vue, such as `vue3-lottie` (for Vue 3) or `lottie-web-vue`.
Be aware that animations created with very recent After Effects plugins might not render correctly. Test thoroughly. Consider newer wrappers that utilize the latest `lottie-web` library.
Always use `import Lottie from 'vue-lottie';` when importing the component after installing it via npm.
Ensure `Lottie` is imported and listed in the `components` option of your Vue component, e.g., `components: { 'lottie': Lottie }`. Alternatively, register it globally via `Vue.component('lottie', Lottie);` in your main application entry file.Verify that your `pinjump.json` (or equivalent) file is correctly imported and that the `animationData` property in your `defaultOptions` object holds a valid JSON animation data object.
Ensure that `handleAnimation` has been called and `this.anim` has been populated before attempting to call any Lottie animation methods. Add null/undefined checks before calling methods on `this.anim`.