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() {
1 diff --git a/src/oj/problem/detail.vue b/src/oj/problem/detail.vue index 1dc8a60..f67760a 100644 --- a/src/oj/problem/detail.vue +++ b/src/oj/problem/detail.vue @@ -36,7 +36,7 @@ onMounted(() => { - + @@ -52,10 +52,14 @@ onMounted(() => { 3 - + - + diff --git a/src/shared/user/login.vue b/src/shared/user/login.vue index e1538af..a84c5fb 100644 --- a/src/shared/user/login.vue +++ b/src/shared/user/login.vue @@ -63,10 +63,10 @@ function goSignup() { label-position="right" label-width="70px" > - + - +