dotlottie / player-component

https://dotlottie.io
MIT License
205 stars 27 forks source link

How do I know if a Vue Nuxt animation is loaded? #327

Open fenn1ks opened 2 months ago

fenn1ks commented 2 months ago

How can I access the event in Vue Nuxt when the animation is loaded? I want to make a loading preloader before it is loaded, and after the animation is loaded show it

fenn1ks commented 2 months ago

And so, I decided this way, maybe it will be useful to someone

      <dotlottie-player
        v-show="lottieLoad"
        ref="lottieplayer"
        autoplay
        loop
        mode="normal"
      />
      const lottie = await this.$refs.lottieplayer
        lottie.addEventListener('ready', () => {
          this.lottieLoad = true
        })
        lottie.load(this.lottieSrc)