mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-22 20:51:09 +08:00
13 lines
262 B
JavaScript
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)
|