mirror of
https://github.com/xxxsf/vue3-h5-template.git
synced 2025-04-28 05:46:35 +08:00
12 lines
372 B
TypeScript
12 lines
372 B
TypeScript
import { computed } from "vue"
|
|
import { useAppStore } from "@/store/modules/app"
|
|
import { DeviceEnum } from "@/constants/app-key"
|
|
|
|
const appStore = useAppStore()
|
|
const isMobile = computed(() => appStore.device === DeviceEnum.Mobile)
|
|
const isDesktop = computed(() => appStore.device === DeviceEnum.Desktop)
|
|
|
|
export function useDevice() {
|
|
return { isMobile, isDesktop }
|
|
}
|