关于官方文档Animation Api 在onShow中使用失效的问题
发布于 5 年前 作者 vxiang 1041 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 预期表现

如上图

  • 复现路径

如上图

  • 提供一个最简复现 Demo

Page({

data: {

},

onShow: function () {

console.log(‘onShow’)

//did not work

// this.testAnimation()

},

onReady: function () {

console.log(‘onReady’)

//worked

this.testAnimation()

},

testAnimation:function(){

const animation = wx.createAnimation({

duration: 2000,

timingFunction: ‘ease’,

delay: 0,

})

animation

.scale(4, 4)

.step()

.scale(2, 2)

.step({ duration: 200 })

.scale(4, 4)

.step({ duration: 200 })

this.setData({

animationData: animation.export()

})

}

})

1 回复

你好,请具体说明下问题表现,提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部