fitzhavey/lottie-player-vue

Loading twice

Opened this issue · 0 comments

When the "step" become "2", generate double lottiefiles.
My code:

HTML


 <figure class="p-finalizacao__figure">
     <lottie-player :src="lottieSrc" :options="lottieOptions" />
 </figure>

TS

  get lottieSrc() {
    if (this.step === 1) {
      return require('../../../static/lottiefile/file-moving.json')
    } else if (this.step === 2) {
      return require('../../../static/lottiefile/extract.json')
    }
  }

  get lottieOptions() {
    const options = {
      autoplay: true,
      speed: 2.5,
      width: '100%',
      loop: true
    }

    if (this.step === 2) {
      options.width = '200px'
      options.speed = 1.5
    }

    return options
  }

image