|
il y a 11 mois | |
---|---|---|
.. | ||
components | il y a 11 mois | |
utssdk | il y a 11 mois | |
changelog.md | il y a 11 mois | |
package.json | il y a 11 mois | |
readme.md | il y a 11 mois |
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()
}
可以参考createanimation,但uniappX支持的动画有限property