@@ -131,6 +134,15 @@ function goHome() {
菜单
+
+ {{ screenSwitchLabel }}
+
{
+ if (screenMode.value === ScreenMode.both) return "题目 | 代码"
+ else if (screenMode.value === ScreenMode.problem) return "仅题目"
+ return "仅代码"
+})
+
+export function switchScreenMode() {
+ if (screenMode.value === ScreenMode.both) {
+ screenMode.value = ScreenMode.problem
+ return
+ }
+ screenMode.value += 1
+}
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 61e5963..fafbf4f 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -267,3 +267,9 @@ export const CODE_TEMPLATES = {
JavaScript: blankTemplate,
Golang: blankTemplate,
}
+
+export enum ScreenMode {
+ problem,
+ code,
+ both,
+}