From fa54fbcbe75a3adcdfa0c301900e0203e234c348 Mon Sep 17 00:00:00 2001 From: YangFong Date: Mon, 8 Jul 2024 22:32:26 +0800 Subject: [PATCH] fix: compatible with codemirror for use in vue3 --- src/stores/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stores/index.js b/src/stores/index.js index 19420cc9a..b5a201162 100644 --- a/src/stores/index.js +++ b/src/stores/index.js @@ -1,3 +1,4 @@ +import { markRaw } from 'vue' import { createPinia, defineStore } from 'pinia' import { marked } from 'marked' import CodeMirror from 'codemirror/lib/codemirror' @@ -148,7 +149,7 @@ export const useStore = defineStore(`store`, { cssEditorDom.value = localStorage.getItem(`__css_content`) || DEFAULT_CSS_CONTENT } - this.cssEditor = CodeMirror.fromTextArea(cssEditorDom, { + this.cssEditor = markRaw(CodeMirror.fromTextArea(cssEditorDom, { mode: `css`, theme: `style-mirror`, lineNumbers: false, @@ -163,7 +164,7 @@ export const useStore = defineStore(`store`, { }, [`${modPrefix}-S`]: function save(_editor) {}, }, - }) + })) }, editorRefresh() { const renderer = this.wxRenderer.getRenderer(this.citeStatus)