jdcProject_front/src/hooks/useDevice.ts

12 lines
372 B
TypeScript
Raw Normal View History

2024-02-06 13:39:56 +08:00
import { DeviceEnum } from "@/constants/app-key"
2024-11-18 19:40:44 +08:00
import { useAppStore } from "@/store/modules/app"
import { computed } from "vue"
2024-02-06 13:39:56 +08:00
const appStore = useAppStore()
const isMobile = computed(() => appStore.device === DeviceEnum.Mobile)
const isDesktop = computed(() => appStore.device === DeviceEnum.Desktop)
export function useDevice() {
return { isMobile, isDesktop }
}