uniapp 创建元素动画

2022年6月25日 185点热度 0人点赞 0条评论
<template>  <view class="content">    <view :animation="animationData" style="background:red;height:30rpx;width:30rpx" @click="rotateAndScale"></view>  </view></template>
<script> export default { data() { return { animationData: {}, } }, methods: { rotateAndScale: function() { // 创建动画 var animation = uni.createAnimation({ duration: 1000, timingFunction: 'ease', }) // 赋值 this.animation = animation // 具体的动画 可链接写 就是css3的那些属性 animation.scale(2, 2).step() animation.translateY(200).step() animation.scale(1, 1).step() animation.rotate(1260).step() animation.backgroundColor('blue').step() animation.width('100%').step() animation.rotate(0).step() animation.translateY(0).step() animation.height('100vh').step() animation.backgroundColor('purple').step() animation.height('10vh').step() // 赋值 this.animationData = animation.export() }, } }</script>

46800uniapp 创建元素动画

这个人很懒,什么都没留下

文章评论