logue / vue-codemirror6

⌨️ @codemirror 6 component for @vuejs. Vue2 & Vue3 both supported.
https://logue.dev/vue-codemirror6/
MIT License
122 stars 16 forks source link

syntax highlighting isn't working for me #39

Open franilones opened 1 month ago

franilones commented 1 month ago

Hi! I'm not able to do syntax highlighting works, I'm not sure if it is my problem or if something of the dependency. I'm using vue3 with nuxt. Here is my code component:

 <template>
  <client-only>
    <code-mirror v-model="value"
                 :extensions="extensions"
                 :style="{ height: '400px', width: '600px'}"
                 :tab-size="2"
                 :lang="css()"
                 tab/>
  </client-only>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import CodeMirror from 'vue-codemirror6';
import type { LanguageSupport } from '@codemirror/language';
import { javascript } from '@codemirror/lang-javascript';
import { python } from "@codemirror/lang-python";
import { css } from '@codemirror/lang-css';
import { oneDark } from '@codemirror/theme-one-dark';

const value = ref('/* ESCRIBE TU CSS */');

const langCss: LanguageSupport = css();
const langJs: LanguageSupport = javascript();
const langPython: LanguageSupport = python();
const getExtensions = () => {
  return
};
const extensions = ref([
  oneDark]);

</script>

Thnx a lot!

logue commented 1 month ago

It looks like you are trying to load oneDark with extensions, but use the theme prop for this.