From 0db56b8bd678f4a682553a7a7b02b6cfcb4429c2 Mon Sep 17 00:00:00 2001 From: _Kerman Date: Thu, 22 Feb 2024 18:01:44 +0800 Subject: [PATCH] fix: reset CodeMirror history when route changes (#1328) --- packages/client/internals/Editor.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/client/internals/Editor.vue b/packages/client/internals/Editor.vue index fbb1edc814..2f2dc759d3 100644 --- a/packages/client/internals/Editor.vue +++ b/packages/client/internals/Editor.vue @@ -102,6 +102,11 @@ onMounted(async () => { noteEditor.refresh() }) }) + + watch(currentSlideId, () => { + contentEditor.clearHistory() + noteEditor.clearHistory() + }, { flush: 'post' }) }) const handlerDown = ref(false)