From 3f93adcc2b51819c12a3b8284fadda16a9a60b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Sat, 9 Aug 2025 15:10:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=A3=80=E6=9F=A5=E6=9C=BA?= =?UTF-8?q?=E5=88=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AiEmotion.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index 5fce74d..733be89 100644 --- a/src/views/AiEmotion.vue +++ b/src/views/AiEmotion.vue @@ -1900,7 +1900,11 @@ function isDataLoaded() { // 设置Intersection Observer监听场景应用部分 function setupIntersectionObserver() { - if (!scenarioApplicationRef.value) return; + // 检查 scenarioApplicationRef.value 是否存在且是有效的 DOM 元素 + if (!scenarioApplicationRef.value || !(scenarioApplicationRef.value instanceof Element)) { + console.warn('scenarioApplicationRef.value 不是有效的 DOM 元素,跳过 IntersectionObserver 设置'); + return; + } const observer = new IntersectionObserver( (entries) => {