add cache for admin problem detail
This commit is contained in:
@@ -20,7 +20,6 @@ const styleTheme = EditorView.baseTheme({
|
||||
})
|
||||
|
||||
interface Props {
|
||||
modelValue: string
|
||||
language?: LANGUAGE
|
||||
fontSize?: number
|
||||
height?: string
|
||||
@@ -36,28 +35,16 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: "",
|
||||
})
|
||||
|
||||
const code = ref(props.modelValue)
|
||||
const code = defineModel<string>("value")
|
||||
|
||||
const isDark = useDark()
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(v) => {
|
||||
code.value = v
|
||||
},
|
||||
)
|
||||
const emit = defineEmits(["update:modelValue"])
|
||||
|
||||
const lang = computed(() => {
|
||||
if (props.language === "Python3" || props.language === "Python2") {
|
||||
return python()
|
||||
}
|
||||
return cpp()
|
||||
})
|
||||
|
||||
function onChange(v: string) {
|
||||
emit("update:modelValue", v)
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<Codemirror
|
||||
@@ -68,6 +55,5 @@ function onChange(v: string) {
|
||||
:tabSize="4"
|
||||
:placeholder="props.placeholder"
|
||||
:style="{ height: props.height, fontSize: props.fontSize + 'px' }"
|
||||
@change="onChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user