JSON νμμΌλ‘ μ λλ©μ΄μ
μ μ μ₯νμ¬ λΉκ΅μ νμΌ ν¬κΈ°κ° μμ Lottie.
Lottieμμ μνλ νμΌμ λ€μ΄λ‘λ λ°μ μ¬μ©ν μ μλ€.
λ°μμ¨ Lottie νμΌμ 미리 νλ μ΄ν΄ λ³Ό μ μλ κ³³
# μ€μΉ
npm install vue3-lottie@latest --save
# yarn add vue3-lottie@latest
# pnpm add vue3-lottie@latest
Usage with Vue 3
Usage with Nuxt 3
/* main.js */
import { createApp } from 'vue'
import Vue3Lottie from 'vue3-lottie'
createApp(App)
.use(Vue3Lottie, { name: 'LottieAnimation' })
.mount('#app')
/* components.d.ts */
declare module '@vue/runtime-core' {
export interface GlobalComponents {
LottieAnimation: typeof import('vue3-lottie')['Vue3Lottie']
}
}
<script setup lang="ts">
import Lottie from 'vue-lottie';
import listLoadingJson from 'src/assets/json/list_loading.json';
</script>
<template>
<Vue3Lottie
:animationData="listLoadingJson"
:height="200"
:width="200"
/>
</template>
π vue3 Lottie
π lottie-webμΌλ‘ Lottieμ λ€μν μ΅μ
μΆκ°νκΈ°