<view id="container" class="circle" animation="{{animationData}}">
<text class="block">test</text>
</view>
.circle {
width: 100rpx;
line-height: 100rpx;
text-align: center;
border-radius: 50%;
background-color:
}
const app = getApp()
Page({
data: {
animationData: {}
},
onLoad() {
this.rotateAnimate()
},
onHide() {
this.clearAnimation('#container')
},
rotateAnimate() {
this.animate('#container', [
{ rotate: 0 },
{ rotate: 90 },
{ rotate: 180 },
{ rotate: 270 },
{ rotate: 360 }
], 5000, () => {
this.rotateAnimate()
})
}
})