chenqingspring / vue-lottie

Render After Effects animations on Vue based on Bodymovin
MIT License
1.31k stars 281 forks source link

如果报错的话,请在animationData后加.default #31

Open lcolok opened 5 years ago

lcolok commented 5 years ago

import * as animationData from './assets/pinjump.json';

log一下animationData发现它是一个module,一定要读取animationData.default才能顺利播放动画

NicholasCao commented 5 years ago

thx

dalys commented 5 years ago

I also had this problem. This import seems to work better

import animationData from 'animations/animation.json';
lottieOptions: {
  animationData,
},