Skip to content

Commit

Permalink
fix: codemirror import error (#1281) (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Feb 11, 2024
1 parent 14fa424 commit b9d29f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/client/setup/codemirror.ts
@@ -1,6 +1,6 @@
import type { Ref, WritableComputedRef } from 'vue'
import { watch } from 'vue'
import * as CodeMirror from 'codemirror'
import * as _CodeMirror from 'codemirror'
import 'codemirror/mode/javascript/javascript'
import 'codemirror/mode/css/css'
import 'codemirror/mode/markdown/markdown'
Expand All @@ -9,6 +9,10 @@ import 'codemirror/mode/htmlmixed/htmlmixed'
import 'codemirror/addon/display/placeholder'
import 'codemirror/lib/codemirror.css'

// eslint-disable-next-line ts/ban-ts-comment
// @ts-expect-error
const CodeMirror: typeof _CodeMirror = _CodeMirror.fromTextArea ? _CodeMirror : globalThis.CodeMirror

export async function useCodeMirror(
textarea: Ref<HTMLTextAreaElement | null | undefined>,
input: Ref<string> | WritableComputedRef<string>,
Expand Down

0 comments on commit b9d29f9

Please sign in to comment.