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

Using OneDark theme throws Runtime Error #53

Open
lthomas122 opened this issue Dec 18, 2024 · 1 comment
Open

Using OneDark theme throws Runtime Error #53

lthomas122 opened this issue Dec 18, 2024 · 1 comment

Comments

@lthomas122
Copy link

I'm trying to use the One Dark theme, but I keep getting the following error:

image

My implementation is as follows:

<template>
    <code-mirror v-model="value" basic tab wrap :dark="true" :theme="oneDark" :lang="lang" />
</template>

<script>
import { ref, defineComponent } from 'vue';

import CodeMirror from 'vue-codemirror6';
import { python } from '@codemirror/lang-python';
import { oneDark } from '@codemirror/theme-one-dark';

export default defineComponent({
    components: {
        CodeMirror,
    },
    setup() {
        const lang = python();
        const value = ref('// start typing Python code or something...');

        return { value, lang, oneDark };
    },
});
</script>
@lthomas122
Copy link
Author

UPDATE: Seems to work if I implement the theme via the extensions prop, which isn't as described in the docs/readme:

<template>
    <code-mirror v-model="value" basic tab wrap :dark="true" :extensions="extensions" :lang="lang" />
</template>

<script>
import { ref, defineComponent } from 'vue';

import CodeMirror from 'vue-codemirror6';
import { python } from '@codemirror/lang-python';
import { oneDark } from '@codemirror/theme-one-dark';

export default defineComponent({
    components: {
        CodeMirror,
    },
    setup() {
        const lang = python();
        const value = ref('// start typing Python code or something...');
        const extensions = [python(), oneDark];

        return { value, lang, extensions };
    },
});
</script>

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

1 participant