tangning 7 ヶ月 前
コミット
ada6293e0f
1 ファイル変更7 行追加1 行削除
  1. 7 1
      src/components/viewImg/index.vue

+ 7 - 1
src/components/viewImg/index.vue

@@ -56,7 +56,7 @@
         </div>
       </div>
     </div>
-    <el-dialog v-model="visible.show"  title="查看视频" width="500">
+    <el-dialog v-model="visible.show"  title="查看视频" width="500" @close="close">
       <video :src="visible.src" v-if="visible.show" ref="videoPlayer" style="width: 100%; height: 300px;" controls class="video-js">
         <source :src="visible.src"  type="video/mp4">
       </video>
@@ -120,6 +120,7 @@ const visible = ref({
   src: "",
 });
 const deleteVal = ref(props.deleteShow);
+const videoPlayer = ref(null);
 const currSize = ref({ width: 0, height: 0 });
 const fileList = ref([".doc", ".docx", ".pdf", ".xls", ".xlsx"]);
 const initFileList = ref([
@@ -179,6 +180,11 @@ const handleItem = (type, item) => {
   }
   emits("handleItem", type, item);
 };
+const close = () => {
+  visible.value.show = false;
+  videoPlayer.value && videoPlayer.value.pause();
+
+};
 const del = async (file) => {
   console.log(file, "file");
   ElMessageBox.confirm("确定删除?", "提示", {