slim code highlight.

This commit is contained in:
2023-04-18 13:59:52 +08:00
parent 76618660d5
commit 80c20a8d08
7 changed files with 14 additions and 68 deletions

View File

@@ -2,8 +2,6 @@
import { Codemirror } from "vue-codemirror"
import { cpp } from "@codemirror/lang-cpp"
import { python } from "@codemirror/lang-python"
import { java } from "@codemirror/lang-java"
import { javascript } from "@codemirror/lang-javascript"
import { EditorView } from "@codemirror/view"
import { oneDark } from "./themes/oneDark"
import { smoothy } from "./themes/smoothy"
@@ -42,10 +40,10 @@ watch(
const emit = defineEmits(["update:modelValue"])
const lang = computed(() => {
if (props.language === "C" || props.language === "C++") return cpp()
if (props.language === "Java") return java()
if (props.language === "JavaScript") return javascript()
return python()
if (props.language === "Python3" || props.language === "Python2") {
return python()
}
return cpp()
})
function onChange(v: string) {