fix(custom): 修复页面卸载时音频不停止的bug
This commit is contained in:
@@ -307,6 +307,7 @@ const startRun = (name: string) => {
|
||||
setTimeout(() => {
|
||||
getList()
|
||||
getUserInfo()
|
||||
startMusic('https://files.wanzhuanyongcheng.com/file/music/yaotouzi/3.mp3', true)
|
||||
}, 2000)
|
||||
}, rotateSpeed * 1000)
|
||||
}
|
||||
@@ -416,10 +417,12 @@ const getBetJl = () => {
|
||||
|
||||
Taro.useDidHide(() => {
|
||||
ws.value?.close()
|
||||
innerAudioContext.stop()
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
ws.value?.close()
|
||||
innerAudioContext.stop()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user