初始化

This commit is contained in:
zg
2026-07-15 16:13:27 +08:00
parent 6d6f559793
commit c4023c1623
276 changed files with 42622 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
/**
* 响应式检测是否为手机屏幕(宽度 <= 768px
* 用于桌面表格 / 手机卡片的条件渲染
*/
import { ref, onMounted, onUnmounted } from 'vue'
export function useIsMobile() {
const isMobile = ref(window.innerWidth <= 768)
function check() {
isMobile.value = window.innerWidth <= 768
}
onMounted(() => window.addEventListener('resize', check))
onUnmounted(() => window.removeEventListener('resize', check))
return isMobile
}