mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-01 23:47:39 +08:00
feat: add initial Nuxt frontend with SSR
This commit is contained in:
12
frontend_nuxt/utils/screen.js
Normal file
12
frontend_nuxt/utils/screen.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user