lottie-miniprogram
lottie-miniprogram copied to clipboard
真机调试报错 Unhandled promise rejection TypeError: r.Canvas is not a constructor
微信版本: 7.0.10 基础库版本: 2.10.1
开发者工具上不报错且动画正常显示,启动真机调试及预览模式报错,动画不显示
`
_initLottie() {
this.createSelectorQuery()
.select('#canvas')
.node(res => {
const canvas = res.node
const context = canvas.getContext('2d')
canvas.width = 480
canvas.height = 480
context.translate(0, 300)
lottie.setup(canvas)
this.ani = lottie.loadAnimation({
loop: true,
autoplay: true,
path: 'https://static.jiebao.zhenai.com/web-mp/activity/lib/lottie-match.json',
rendererSettings: {
context,
},
})
})
.exec()
},`
真机调试还未支持,直接预览也报错吗?
同样的错误,请问你是怎么解决的?