This commit is contained in:
2023-05-04 21:56:15 +08:00
parent 4aa70f22ed
commit a0c091ee76
6 changed files with 58 additions and 110 deletions

View File

@@ -23,6 +23,7 @@ interface Props {
fontSize?: number
height?: string
readonly?: boolean
placeholder?: string
}
const props = withDefaults(defineProps<Props>(), {
@@ -30,6 +31,7 @@ const props = withDefaults(defineProps<Props>(), {
fontSize: 20,
height: "100%",
readonly: false,
placeholder: "",
})
const code = ref(props.modelValue)
@@ -55,11 +57,12 @@ function onChange(v: string) {
<template>
<Codemirror
v-model="code"
:extensions="[styleTheme, lang, isDark ? oneDark : smoothy]"
indentWithTab
:extensions="[styleTheme, lang, isDark ? oneDark : smoothy]"
:disabled="props.readonly"
:tabSize="4"
@change="onChange"
:placeholder="props.placeholder"
:style="{ height: props.height, fontSize: props.fontSize + 'px' }"
@change="onChange"
/>
</template>

View File

@@ -59,15 +59,6 @@ const menus = computed<MenuOption[]>(() => [
show: userStore.isAdminRole,
key: "admin",
},
{
label: () =>
h(
RouterLink,
{ to: "/play", target: "_blank" },
{ default: () => "自测" }
),
key: "play",
},
])
const options: Array<DropdownOption | DropdownDividerOption> = [