From 69494808b8ce6a39b161649b5e444f2f6f836628 Mon Sep 17 00:00:00 2001 From: unknown <qq1940665526@163.com> Date: 星期一, 17 六月 2024 17:19:58 +0800 Subject: [PATCH] 优化 --- src/components/examinations/index.vue | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue index ff6a449..5986ef3 100644 --- a/src/components/examinations/index.vue +++ b/src/components/examinations/index.vue @@ -474,6 +474,7 @@ </template> <script> +import { Message } from 'element-ui'; export default { name: "examination-option", props: { @@ -637,13 +638,10 @@ } }, // 淇濆瓨鎸夐挳 - saveAnswer() { - const element = ( - this.container ? this.container : document - ).querySelector(".examination"); - if (element) { + saveAnswer(e) { + if (e.srcElement) { const pageNum = this.getParentWithClass( - element, + e.srcElement, "page-box" ).getAttribute("page"); const oldAnswerData = localStorage.getItem( @@ -674,6 +672,7 @@ this.config.activeBook.name + "oldAnswerData", JSON.stringify(oldData) ); + Message.success('淇濆瓨鎴愬姛') } // if(oldData[this.chapter]) { -- Gitblit v1.9.1