vue-codemirror icon indicating copy to clipboard operation
vue-codemirror copied to clipboard

how to json for extensions?

Open xuxweei opened this issue 1 year ago • 0 comments

Describe the bug

i use @codemirror/lang-json and i refer to the document to use javascript to write but it gives me the prompt “Unrecognized extension value in extension set ([object Object])“. can tell me how to use it? this is my code:

<Codemirror
        v-model="codemirrorContent"
        style="
          height: 450px;
          overflow: hidden;
          text-align: left;
          border: 1px solid #ccc;
	"
	:extensions="extensions" 
>
</Codemirror>
<script setup lang="ts">
import { json } from "@codemirror/lang-json";
import { oneDark } from "@codemirror/theme-one-dark";
const extensions = [json(),oneDark]
</script>

Reproduction

image

System Info

![image](https://github.com/surmon-china/vue-codemirror/assets/62375498/4dba25af-c29b-4b3b-896a-31366303bf35)

Used Package Manager

npm

Validations

  • [X] Read the the documentation in detail.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
  • [X] The provided reproduction is a minimal reproducible example of the bug.

xuxweei avatar May 25 '23 03:05 xuxweei