switch screen size.
This commit is contained in:
17
src/shared/composables/switchScreen.ts
Normal file
17
src/shared/composables/switchScreen.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user