Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import LottieAnimation - Argument of type '{ animationData: any; autoPlay ... Property 'LottieAnimation' is missing in type #20

Open
garbit opened this issue Jun 21, 2023 · 0 comments

Comments

@garbit
Copy link
Owner

garbit commented Jun 21, 2023

Bug report raised using the following code:

Using the following doesn't work in version 2.0.7:

import LottieAnimation from "lottie-web-vue"

Fix:

import { LottieAnimation } from "lottie-web-vue"
<script setup lang="ts">
import { LottieAnimation } from "lottie-web-vue"
import WatermelonJSON from "./assets/watermelon.json"
</script>

<template>
  <div>
    <LottieAnimation :animation-data="WatermelonJSON" :auto-play="true" :loop="true" :speed="1" ref="anim" />
  </div>
</template>

Typescript Error:

Argument of type '{ animationData: any; autoPlay: boolean; loop: boolean; speed: number; ref: string; }' is not assignable to parameter of type 'typeof import("/Users/andy/development/lottie-web-vue-test/node_modules/lottie-web-vue/dist/index") & Record<string, unknown>'.
  Property 'LottieAnimation' is missing in type '{ animationData: any; autoPlay: boolean; loop: boolean; speed: number; ref: string; }' but required in type 'typeof import("/Users/andy/development/lottie-web-vue-test/node_modules/lottie-web-vue/dist/index")'.ts(2345)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant