switch screen size.

This commit is contained in:
2023-10-11 16:02:31 +08:00
parent 3ac19cdb4b
commit 9cf73331ea
7 changed files with 181 additions and 121 deletions

View File

@@ -0,0 +1,17 @@
import { ScreenMode } from "~/utils/constants"
export const screenMode = ref(ScreenMode.both)
export const screenSwitchLabel = computed(() => {
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
}