瀏覽代碼

mod:编辑 关闭 摄像头

panqiuyao 7 月之前
父節點
當前提交
ca4e4492bd
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      frontend/src/views/Photography/check.vue

+ 3 - 2
frontend/src/views/Photography/check.vue

@@ -87,9 +87,11 @@ const socketStore = socket(); // WebSocket状态管理实例
 const emit = defineEmits([ 'confirm','onClose']);
 
 const confirm = ()=>{
+  hideVideo()
   emit('confirm')
 }
 const onClose = ()=>{
+  hideVideo()
   emit('onClose')
 }
 // 定义 props
@@ -248,11 +250,10 @@ onMounted(()=>{
  * 页面卸载时移除所有事件监听器。
  */
 onBeforeUnmount(() => {
+  hideVideo()
   clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
   clientStore.ipc.removeAllListeners(icpList.camera.PreviewHide);
   clientStore.ipc.removeAllListeners(icpList.camera.PreviewShow);
-
-
 })
 </script>
 <style scoped lang="scss">