diff --git a/components.d.ts b/components.d.ts index 0356d63..c786e6f 100644 --- a/components.d.ts +++ b/components.d.ts @@ -28,6 +28,9 @@ declare module 'vue' { DSelect: typeof import('vue-devui/select/index.es.js')['Select'] DTab: typeof import('vue-devui/tabs/index.es.js')['Tab'] DTabs: typeof import('vue-devui/tabs/index.es.js')['Tabs'] + DTag: typeof import('vue-devui/tag/index.es.js')['Tag'] + DTagGroup: typeof import('vue-devui/tag-group/index.es.js')['TagGroup'] + DTags: typeof import('vue-devui/tags/index.es.js')['Tags'] HomeSide: typeof import('./src/components/homeSide.vue')['default'] MenuH: typeof import('./src/components/menuH.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/components/menuH.vue b/src/components/menuH.vue index 80e71ad..c546d80 100644 --- a/src/components/menuH.vue +++ b/src/components/menuH.vue @@ -117,9 +117,9 @@ const getLocation = () => { break; } const res = await $http.mix.getIp(); - latitude.value = res.data.lat; - longitude.value = res.data.lon; - const jw = `${longitude.value?.toFixed(2)},${latitude.value?.toFixed(2)}`; + latitude.value = Number(res.data.data.lat); + longitude.value = Number(res.data.data.lng); + const jw = `${longitude.value?.toFixed(4)},${latitude.value?.toFixed(4)}`; // 这里可以添加调用后端API获取具体位置名称的逻辑 handdleJw(jw); @@ -214,7 +214,7 @@ onMounted(() => { getLocation(); // 组件挂载时获取位置 const h: number = nav.value.clientHeight - navx.setNavH(h) + if(h>0) navx.setNavH(h) @@ -223,7 +223,9 @@ onBeforeUpdate(() => { userinfo.value = $cookies.get('userinfo'); key.value = route.name as string; const h: number = nav.value.clientHeight - navx.setNavH(h) + // console.log('******>>> --> nav.value:', nav.value) + // console.log('()()()()()>>> --> h:', h) + if(h>0) navx.setNavH(h) }) diff --git a/src/stores/nav.ts b/src/stores/nav.ts index 4b74f07..154541b 100644 --- a/src/stores/nav.ts +++ b/src/stores/nav.ts @@ -1,5 +1,5 @@ export const useNavStore = defineStore('nav', () => { - const navH:Ref = ref(0) + const navH:Ref = ref(56) function setNavH(v:number) { navH.value = v diff --git a/src/util/index.ts b/src/util/index.ts index ed5e714..e56c2eb 100644 --- a/src/util/index.ts +++ b/src/util/index.ts @@ -159,3 +159,5 @@ export function resetObject>(obj: T): void { (obj as Record)[key] = null; }); } + + diff --git a/src/views/Home.vue b/src/views/Home.vue index 1eea199..7ccc7a6 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -12,10 +12,15 @@ + +
+ {{ tag.name }} +
-