how to formate the code

Here is what the code looks like, why it’s not like the demo shows? All the code align in the center and the cursor is in the center too.

The package is vue-codemirror version 6.1.1,

:style=“{ height: ‘780px’ }”

export default defineComponent({
components: {
setup() {
const value = new EditorView({ doc: "abc", extensions: [ // keymap.of([{key: "Alt-l", run: moveToLine}]), basicSetup, ], parent: document.body })
const extensions = [javascript(), oneDark]
return { value, extensions}

I expect you have some CSS that somehow matches the editor elements and centers text. Use the devtools to find out.

yes, solved it by setting text-align in the class v-codemirror. thx.