sq652366
<template>
  <div>
    <lottie
      :options="defaultOptions"
      :height="400"
      :width="400"
      v-on:animCreated="handleAnimation"
    />
    <div>数字</div>
  </div>
</template>

 

<script>
  import Lottie from \'vue-lottie\' //第三方插件
  import * as animationData from \'./assets/data.json\' //需要展示的json动画
  export default {
    components: {
      lottie: Lottie, //注册动画组件
    },
    data() {
      return {
        defaultOptions: { animationData: animationData.default },
      }
    },
    methods: {
      handleAnimation: function (anim) {
        this.anim = anim
      },
    },
}
</script>
//josn 文件是ui 将动画图转出的 

分类:

技术点:

相关文章: