在live-player组件中嵌入了一个组件,这个组件有个setInterval操作,IOS下不正常。
代码如下:
showToast({ title: `${count}`, icon: 'none' }); // 这里的count是好的,但下面的count 不正常
return <View
style={`width: ${_pixel}px; height: ${_pixel}px;`}
className="countdown-container flex flex-item-center flex-justify-center">
<Canvas style={`width: ${_pixel}px; height: ${_pixel}px;z-index: 0;`} id="cvs1" type="2d"></Canvas>
<Canvas style={`width: ${_pixel}px; height: ${_pixel}px;z-index: 1;`} id="cvs2" type="2d"></Canvas>
<Canvas style={`width: ${_pixel}px; height: ${_pixel}px;z-index: 2;`} id="cvs3" type="2d"></Canvas>
<View className="flex flex-col flex-justify-center flex-item-center">
<View className="timer-count flex flex-item-center flex-justify-center"> {count} </View>
<View className="timer-tips flex flex-item-center" > 倒计时 (S) </View>
</View>
</View >
已经排除taro的问题,写了一个测试代码。
https://developers.weixin.qq.com/s/6rV7hlmo7Gsz