From 0e8066a203f35bc4e20b64113829975c5b48252b Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 06 六月 2024 17:38:56 +0800
Subject: [PATCH] 答题器保存功能优化

---
 src/components/examinations/index.vue |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue
index b31b7a1..9e462e0 100644
--- a/src/components/examinations/index.vue
+++ b/src/components/examinations/index.vue
@@ -573,13 +573,13 @@
     },
     // 淇濆瓨鎸夐挳
     saveAnswer() {
-      const element = document.getElementsByClassName("examination")[0];
+      const element = (this.container ? this.container : document
+      ).querySelector(".examination");
       if (element) {
         const pageNum = this.getParentWithClass(
           element,
           "page-box"
         ).getAttribute("page");
-        console.log(this.config.activeBook.name, pageNum);
         const oldAnswerData = localStorage.getItem(
           this.config.activeBook.name + "oldAnswerData"
         );

--
Gitblit v1.9.1