From 7bea386dbc719b16cb6095a1af8ab7f5c77fa17d Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Sun, 8 Jan 2023 10:04:41 +0800 Subject: [PATCH] use ojtest for test api. --- src/oj/problem/components/editor.vue | 7 ++++--- src/oj/problem/detail.vue | 10 +++++++--- src/shared/user/login.vue | 4 ++-- vite.config.ts | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/oj/problem/components/editor.vue b/src/oj/problem/components/editor.vue index 2f760c1..730f034 100644 --- a/src/oj/problem/components/editor.vue +++ b/src/oj/problem/components/editor.vue @@ -7,7 +7,7 @@ import { LANGUAGE_VALUE, SOURCES, } from "../../../utils/constants" -import { isDesktop } from "../../../utils/breakpoints" +import { isMobile } from "../../../utils/breakpoints" const { problem } = defineProps<{ problem: { @@ -19,6 +19,7 @@ const { problem } = defineProps<{ const state = reactive({ values: ref({ ...SOURCES }), language: problem.languages[0] || "C", + isMobile, }) const monacoEditorRef = ref() @@ -69,7 +70,7 @@ async function init() { lineNumbersMinChars: 3, automaticLayout: true, // 自适应布局 tabSize: 4, - fontSize: 24, // 字体大小 + fontSize: state.isMobile ? 16 : 24, // 字体大小 scrollBeyondLastLine: false, // 取消代码后面一大段空白 }) monaco.editor.getModels()[0].onDidChangeContent(() => { @@ -97,7 +98,7 @@ async function init() {