Sfoglia il codice sorgente

Update video-play.tsx

lex 1 anno fa
parent
commit
461ef2affd
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7 1
      src/views/coursewarePlay/component/video-play.tsx

+ 7 - 1
src/views/coursewarePlay/component/video-play.tsx

@@ -84,7 +84,7 @@ export default defineComponent({
     const videoRef = ref()
     const videoRef = ref()
     const videoItem = ref()
     const videoItem = ref()
     const videoID = 'video' + Date.now() + Math.floor(Math.random() * 100)
     const videoID = 'video' + Date.now() + Math.floor(Math.random() * 100)
-    const toggleHideControl = (isShow: false) => {
+    const toggleHideControl = (isShow: boolean) => {
       data.showBar = isShow
       data.showBar = isShow
     }
     }
     // const togglePlay = (e: Event) => {
     // const togglePlay = (e: Event) => {
@@ -271,6 +271,12 @@ export default defineComponent({
     })
     })
 
 
     watch(
     watch(
+      () => props.activeModel,
+      () => {
+        toggleHideControl(props.activeModel)
+      }
+    )
+    watch(
       () => props.item,
       () => props.item,
       () => {
       () => {
         videoItem.value?.currentTime(0)
         videoItem.value?.currentTime(0)