只有3d模型的结果卡片才有三级菜单

This commit is contained in:
X1627315083@163.com
2026-03-19 11:14:41 +08:00
parent e70ee74c1f
commit 2486a8bde7
2 changed files with 5 additions and 17 deletions

View File

@@ -7,7 +7,7 @@
<script setup lang="ts">
import FullscreenDialog from '../components/fullscreen-dialog.vue'
import flowCanvas from './flow-canvas.vue'
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { ref } from 'vue'
import { getSketchFlowCanvas, putSketchFlowCanvas } from '@/api/flow-canvas'
import { useI18n } from 'vue-i18n'
@@ -34,21 +34,6 @@
const close = async () => {
dialogVisible.value = false
}
const handleBeforeUnload = (event) => {
const str = flowCanvasRef.value?.getFlowJson()
if (str) {
event.preventDefault()
event.returnValue = $t('flowCanvas.confirmLeave')
return $t('flowCanvas.confirmLeave')
}
}
onMounted(() => {
// 添加事件监听
window.addEventListener('beforeunload', handleBeforeUnload)
})
onBeforeUnmount(() => {
window.removeEventListener('beforeunload', handleBeforeUnload)
})
defineExpose({
open,
close,