From 9f48830b912901ae61a531a3c417c349d439387a Mon Sep 17 00:00:00 2001 From: Zyronon Date: Mon, 13 Oct 2025 10:55:11 +0800 Subject: [PATCH] Update TypingArticle.vue --- src/pages/article/components/TypingArticle.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/article/components/TypingArticle.vue b/src/pages/article/components/TypingArticle.vue index 233d6e68..cdec94e5 100644 --- a/src/pages/article/components/TypingArticle.vue +++ b/src/pages/article/components/TypingArticle.vue @@ -244,10 +244,10 @@ function nextSentence() { } lock = false } - + function onTyping(e: KeyboardEvent) { if (!props.article.sections.length) return - if (isTyping) return; + if (isTyping || isEnd) return; isTyping = true; // console.log('keyDown', e.key, e.code, e.keyCode) try { @@ -319,14 +319,15 @@ function onTyping(e: KeyboardEvent) { } playKeyboardAudio() e.preventDefault() - isTyping = false } catch (e) { //todo 上报 localStorage.removeItem(PracticeSaveArticleKey.key) init() + }finally { + isTyping = false } } - + function play() { let currentSection = props.article.sections[sectionIndex] emit('play', {sentence: currentSection[sentenceIndex], handle: true})