From 9c069d4822689ec4fdf401b5af432460464febec Mon Sep 17 00:00:00 2001 From: dash <1549469775@qq.com> Date: Sun, 23 Nov 2025 01:35:53 +0800 Subject: [PATCH] Implement iframe detection in Project.vue to conditionally render control buttons. This enhancement improves user experience by hiding controls when the component is displayed within an iframe. --- frontend/src/views/Project.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/Project.vue b/frontend/src/views/Project.vue index b05a107..c2f8298 100644 --- a/frontend/src/views/Project.vue +++ b/frontend/src/views/Project.vue @@ -6,7 +6,7 @@ class="preview-iframe" sandbox="allow-scripts allow-same-origin allow-forms" > -
+
@@ -111,6 +111,10 @@ const documentVisible = ref(false); const currentDocument = ref(null); const previewUrl = ref(''); +const isInIframe = computed(() => { + return window.self !== window.top; +}); + const canEdit = computed(() => { if (!project.value) return false; return userStore.isAuthenticated &&