方法一
js:
anim() {
let that = this;
var animation = uni.createAnimation({
duration: 3000,
timingFunction: 'ease'
});
this.animation = animation;
animation.rotateX(180).step();
this.animationData = animation.export();
},
图片
<image ref="test" :animation="animationData" src="../../static/livePush/load.png" mode="aspectFill" class="load"></image>
就是想让这个动画旋转,H5有效果,App现在没有效果
方法二
anim(){
let that=this
let el = this.$refs.test;
animation.transition(el, {
styles: {
transform: 'rotate(360deg)',
},
duration: 8000, //ms
timingFunction: 'linear',
needLayout: false,
delay: 0 //ms
}, function(res) {
console.log(res);
that.anim();
})
},
<image ref='test' src="../../static/livePush/load.png" mode="aspectFill" class="load"></image>
两种都没有效果,马上自闭了
2***@qq.com
妙哉妙哉
2024-12-28 15:09