Installation
Explains how to install the Lottie-Vue component.
Ensure that you have npm or yarn installed before installing this component.
- Install package using npm or yarn.
npm install --save @lottiefiles/vue-lottie-player (or)
yarn add @lottiefiles/vue-lottie-player
- Import the
vue-lottie-player
package in your code.
import LottieVuePlayer from '@lottiefiles/vue-lottie-player';
- Add the player as a plugin to Vue:
Vue.use(LottieVuePlayer);
- Install package using npm or yarn.
npm install --save @lottiefiles/vue-lottie-player (or)
yarn add @lottiefiles/vue-lottie-player
- Create a folder called plugins at the root of your project.
- Create a file named lottie-vue-player.client.js inside the plugins directory.
- Add the following code to the lottie-vue-player.client.js file.
import Vue from 'vue';
import LottieVuePlayer from "@lottiefiles/vue-lottie-player";
Vue.use(LottieVuePlayer);
- Add the following line to the nuxt.config.js file:
plugins: [
"~/plugins/lottie-vue-player.client.js"
]
To rapidly build and view the Vue interface:
- 1.
- 2.Run
yarn install
Last modified 1yr ago