easegen-front/src/views/myCourse/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
easegen-front/src/views/myCourse/index.vue
@@ -534,6 +534,9 @@ const currentPlayUrl = ref('') const videoRefs = ref<HTMLVideoElement[]>([]) //计时器 const Timer = ref() // 获取视频列表 const getList = async () => { loading.value = true @@ -1167,9 +1170,27 @@ stopPolling() }) //计时器轮询 const TimerList = ( () => { Timer.value = setInterval( ()=>{getList()}, 5000 ) } ) //清楚计时器 const ClearTimerList = ( () => { clearInterval(Timer.value) Timer.value = null } ) // 初始化 onMounted(() => { //加载数据 getList() //调用计时器 TimerList() }) //清楚计时器 onUnmounted( ()=>{ ClearTimerList() }) // 播放预览