change code editor to codemirror.
This commit is contained in:
@@ -5,7 +5,7 @@ import { code } from "oj/composables/code"
|
||||
import { isDesktop } from "~/shared/composables/breakpoints"
|
||||
import Form from "./Form.vue"
|
||||
|
||||
const Monaco = defineAsyncComponent(() => import("~/shared/Monaco.vue"))
|
||||
const CodeEditor = defineAsyncComponent(() => import("~/shared/CodeEditor.vue"))
|
||||
|
||||
interface Props {
|
||||
problem: Problem
|
||||
@@ -23,16 +23,11 @@ const editorHeight = computed(() =>
|
||||
|
||||
<template>
|
||||
<Form :problem="props.problem" />
|
||||
<Monaco
|
||||
class="editor"
|
||||
<CodeEditor
|
||||
v-model:value="code.value"
|
||||
:language="code.language"
|
||||
:height="editorHeight"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.editor {
|
||||
min-height: 200px;
|
||||
}
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { code } from "oj/composables/code"
|
||||
import party from "party-js"
|
||||
import { Ref } from "vue"
|
||||
import { SOURCES, JUDGE_STATUS, SubmissionStatus } from "utils/constants"
|
||||
import { JUDGE_STATUS, SubmissionStatus } from "utils/constants"
|
||||
import { submissionMemoryFormat, submissionTimeFormat } from "utils/functions"
|
||||
import { Problem, Submission, SubmitCodePayload } from "utils/types"
|
||||
import { getSubmission, submitCode } from "oj/api"
|
||||
@@ -65,12 +65,7 @@ const submitDisabled = computed(() => {
|
||||
if (!userStore.isAuthed) {
|
||||
return true
|
||||
}
|
||||
const value = code.value
|
||||
if (
|
||||
value.trim() === "" ||
|
||||
value === problem!.value.template[code.language] ||
|
||||
value === SOURCES[code.language]
|
||||
) {
|
||||
if (code.value.trim() === "") {
|
||||
return true
|
||||
}
|
||||
if (judging.value || pending.value || submitting.value) {
|
||||
|
||||
Reference in New Issue
Block a user