视频里面是正常使用代码
this.gouzi_line = gsap.to(".gouzi_line" , {
duration: this.swing_speed,
rotation: 60,
ease: "power1.inOut",
repeat: Infinity,
yoyo: true
})
但是上面的代码不能再APP内运行
uni.createSelectorQuery()
.in(this)
.select("#gouzi_line")
.boundingClientRect()
.exec((res) => {
const element = res[0]; // Get the first result
if (element) {
this.gouzi_line = gsap.to(element , {
duration: this.swing_speed,
rotation: 60,
ease: "power1.inOut",
repeat: Infinity,
yoyo: true
})
} else {
console.error("Element not found");
}
});
我换成了这段代码也不行 有么有人能给个好办法