mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-18 13:01:02 +08:00
15 lines
347 B
JavaScript
15 lines
347 B
JavaScript
import { ref, computed } from 'vue'
|
|
|
|
const width = ref(0)
|
|
const isClient = ref(false)
|
|
|
|
if (typeof window !== 'undefined') {
|
|
isClient.value = true
|
|
width.value = window.innerWidth
|
|
window.addEventListener('resize', () => {
|
|
width.value = window.innerWidth
|
|
})
|
|
}
|
|
|
|
export const isMobile = computed(() => isClient.value && width.value <= 768)
|