移动端适配

This commit is contained in:
李志鹏
2026-05-28 11:05:51 +08:00
parent d404f5ceac
commit 6415523eef
12 changed files with 125 additions and 21 deletions

View File

@@ -3,6 +3,7 @@ import { ref, computed } from 'vue'
export const useGlobalStore = defineStore('global', () => {
const state = ref({
loading: false,// 全局loading
windowWidth: window.innerWidth,// 页面宽度
})
const setLoading = (v: boolean) => { state.value.loading = v }
@@ -12,3 +13,6 @@ export const useGlobalStore = defineStore('global', () => {
setLoading,
}
})
window.addEventListener('resize', () => {
useGlobalStore().state.windowWidth = window.innerWidth
})