代码高亮

This commit is contained in:
2025-02-25 11:02:04 +08:00
parent 942c1fb59d
commit 9a289d8c39
10 changed files with 56 additions and 353 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { EditorView } from "@codemirror/view"
import { Codemirror } from "vue-codemirror"
import { smoothy } from "../themes/smoothy.ts"
import { githubLight } from "@fsegurai/codemirror-theme-github-light"
import { css } from "@codemirror/lang-css"
import { javascript } from "@codemirror/lang-javascript"
import { html } from "@codemirror/lang-html"
@@ -45,7 +45,7 @@ const lang = computed(() => {
<Codemirror
v-model="code"
indentWithTab
:extensions="[styleTheme, lang, smoothy]"
:extensions="[styleTheme, lang, githubLight]"
:tabSize="4"
:style="{ height: '100%', fontSize: props.fontSize + 'px' }"
/>