更新记录
0.0.2(2024-04-22) 下载此版本
- init
0.0.1(2024-04-22) 下载此版本
- init
平台兼容性
uni-app x
Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
---|---|---|---|---|---|
√ | √ | 5.0 | 12 | - | - |
lime-animateIt 元素动画
- 参考
createAnimation
的实现步骤,当前版本会有各平台表现不一致的问题
安装
在插件市场导入即可
使用
// animationData 没有作用,只为兼容小程序
<view ref="viewRef" :animation="animationData" class="test"></view>
import {createAnimation, CreateAnimationOptions} from '@/uni_modules/lime-animateIt'
const viewRef = ref<UniElement|null>(null)
animation.scaleX(0.5).translateX(200).step()
animation.top(200).scaleX(1.8).step({duration: 600})
animation.top(100).left(-200).step({duration: 2000})
// 非小程序export不导致出任何内容,也不支持下面的参数
// 参数1: 需要动画的元素(非小程序必填)
// 参数2: 循环次数 -1为无限(可选,不填则1次)
animationData.value = animation.export(viewRef,2)
// APP WEB
animation.onFinish = ()=>{
console.log('onFinish')
}
const onClick = ()=>{
// APP WEB
animation.play()
}
const onStop = ()=>{
// APP WEB
animation.stop()
}
API
可以参考createanimation,但uniappX支持的动画有限property