能量管理:清除定时器
This commit is contained in:
parent
ac790b72a8
commit
db9e6efc68
@ -869,6 +869,7 @@ const resizeFn = () => {
|
||||
const stopAutoUpdate = () => {
|
||||
timer && clearInterval(timer)
|
||||
timer = null
|
||||
|
||||
}
|
||||
|
||||
const realDataListSetValue = reactive({
|
||||
@ -919,6 +920,10 @@ const autoUpdateList = () => {
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
const clearListTimer = () => {
|
||||
listTimer && clearInterval(listTimer)
|
||||
listTimer = null
|
||||
}
|
||||
onMounted(() => {
|
||||
getContainerHeight()
|
||||
autoUpdateList()
|
||||
@ -928,6 +933,7 @@ onMounted(() => {
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeFn)
|
||||
stopAutoUpdate()
|
||||
clearListTimer()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user