const { shared, Easing, repeat, timing, cancelAnimation,runOnUI,runOnJS} = wx.worklet
Component({
/**
* 组件的方法列表
*/
methods: {
testTriggerEvent() {
try{
this.setData({
test:1
})
}catch(error){
console.error('f',error)
}
},
onDeleteTapEvent() {
// 动画
var deleteWorkletShareValue = shared(1)
this.applyAnimatedStyle('.deleteView', () => {
'worklet';
return {
transform: `scale(${deleteWorkletShareValue.value})`
}
})
deleteWorkletShareValue.value = repeat(timing(1.5, {
duration: 100,
easing: Easing.linear
}), 2, true, () => {
'worklet';
runOnJS(this.testTriggerEvent)()
})
},
}
})
runOnJS组件的this.testTriggerEvent()函数时出现错误TypeError: this.setData is not a function
应该怎么解决呢
runOnJS(this.testTriggerEvent.bind(this))
有大佬帮忙解答一下吗