translate3d动画,或者使用translateZ效果很怪,可以说没有效果,下例中预期元素应该会下陷至背景中有透视效果,实际效果是元素跳起来并依然保持原始大小,没有透视效果
const rotateX = shared(0)
const y = shared(0)
const z = shared(0)
const originV1 = shared('50%')
const originV2 = shared('0')
this.applyAnimatedStyle('.ele', ()=>{
"worklet"
return {
transformOrigin: `${originV1.value} ${originV2.value}`
transform: `translate3d(0, ${y.value}px, ${z.value}px) rotateX(${rotateX.value})`
}
...
rotateX.value = timing(180)
y.value = timing(-100)
z.value = timing(-260)
originV1.value = timing('50%')
originV2.value = timing('100%')
})
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。