From 330613d7a913d829ca8061c56c71c78216f6d07e Mon Sep 17 00:00:00 2001 From: 1328989942 <1328989942@qq.com> Date: Sat, 25 May 2024 15:46:32 +0000 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E5=86=8D=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/.vuepress/components/HtmlEditor.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/.vuepress/components/HtmlEditor.vue b/src/.vuepress/components/HtmlEditor.vue index f532019b..57a600b2 100644 --- a/src/.vuepress/components/HtmlEditor.vue +++ b/src/.vuepress/components/HtmlEditor.vue @@ -62,8 +62,11 @@ const initEditor = (data) => { javascript(), // 在extensions中配置语言 oneDark, EditorView.updateListener.of((v) => { - const data = v.state.doc; - handleCodeChanged(data); + // 文档更新后再触发 + if(v.docChanged) { + const data = v.state.doc; + handleCodeChanged(data); + } }), ], });