Skip to content

Commit

Permalink
fix: compatible with codemirror for use in vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
YangFong committed Jul 8, 2024
1 parent a1a0947 commit fa54fbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stores/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { markRaw } from 'vue'
import { createPinia, defineStore } from 'pinia'
import { marked } from 'marked'
import CodeMirror from 'codemirror/lib/codemirror'
Expand Down Expand Up @@ -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,
Expand All @@ -163,7 +164,7 @@ export const useStore = defineStore(`store`, {
},
[`${modPrefix}-S`]: function save(_editor) {},
},
})
}))
},
editorRefresh() {
const renderer = this.wxRenderer.getRenderer(this.citeStatus)
Expand Down

0 comments on commit fa54fbc

Please sign in to comment.