Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax highlighting isn't working for me #39

Open
franilones opened this issue May 10, 2024 · 1 comment
Open

syntax highlighting isn't working for me #39

franilones opened this issue May 10, 2024 · 1 comment

Comments

@franilones
Copy link

franilones commented May 10, 2024

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
Copy link
Owner

logue commented May 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants