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

怎么处理需要图片资源的动画 #30

Open
cocacolasummer opened this issue Apr 1, 2019 · 7 comments
Open

怎么处理需要图片资源的动画 #30

cocacolasummer opened this issue Apr 1, 2019 · 7 comments

Comments

@cocacolasummer
Copy link

No description provided.

@xing00
Copy link

xing00 commented Apr 29, 2019

import * as titleAni from '../static/tittle.json' titleAni.assets.forEach(item => { item.u = 图片前缀路径 })

@usercao
Copy link

usercao commented May 29, 2019

@xing00 #10 是相对整个项目的图片文件夹路径吗?

@xing00
Copy link

xing00 commented May 29, 2019

@xing00 是相对整个项目的图片文件夹路径吗?

相对你引入的这个文件里的路径,比如tittle.json,这个文件所有引用的图片的路径

@usercao
Copy link

usercao commented May 29, 2019

data() {
  return {
    defaultOptions: { animationData: animationData.default },
    animationSpeed: 1
  }
}
import * as animationData from '../assets/images/node/lottie/data.json'

animationData.assets.forEach((item, index) => {
  item.u = ''
  item.p = require(`@/assets/images/node/lottie/images/img_${index}.png`)
})

最后这样解决的,相对路径的方法试了还是无法加载出来。

@asmallkite
Copy link

@usercao Thanks

@fftaken
Copy link

fftaken commented Apr 16, 2020

@usercao 牛逼,感谢

@fan240579805
Copy link

@usercao 牛逼,试了贼多办法就你的有用

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

6 participants