Files
OpenIsle/frontend_nuxt/utils/screen.js
2025-08-07 19:18:42 +08:00

13 lines
262 B
JavaScript

import { ref, computed } from 'vue'
const width = ref(0)
if (process.client) {
width.value = window.innerWidth
window.addEventListener('resize', () => {
width.value = window.innerWidth
})
}
export const isMobile = computed(() => width.value <= 768)