Browse Source

feat: 更新 navbar-evo 和 tabbar-evo 组件,优化样式处理和逻辑,删除不再使用的 shims-uni.d.ts 文件

EvilDragon 3 months ago
parent
commit
34de6d9255

+ 3 - 1
packages/app/src/components/navbar-evo.vue

@@ -1,7 +1,7 @@
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { ConfigProviderThemeVars } from 'wot-design-uni'
 import { ConfigProviderThemeVars } from 'wot-design-uni'
 import { useRouter } from '../core/utils/router'
 import { useRouter } from '../core/utils/router'
-import { computed } from 'vue'
+import { type CSSProperties, computed, getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue'
 
 
 const props = withDefaults(
 const props = withDefaults(
   defineProps<{
   defineProps<{
@@ -27,6 +27,8 @@ const handleToHome = () => {
   uni.reLaunch({ url: '/pages/home/index' })
   uni.reLaunch({ url: '/pages/home/index' })
 }
 }
 onMounted(() => {
 onMounted(() => {
+  console.log(1111);
+  
   // console.log(slots.prepend)
   // console.log(slots.prepend)
   // getCurrentPages()
   // getCurrentPages()
   // console.log(getCurrentPages())
   // console.log(getCurrentPages())

+ 3 - 1
packages/merchant/src/components/tabbar-evo.vue

@@ -1,5 +1,6 @@
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { onMounted, ref } from 'vue'
 import { onMounted, ref } from 'vue'
+import { addUnit } from 'wot-design-uni/components/common/util'
 const props = defineProps({
 const props = defineProps({
   items: {
   items: {
     type: Array as PropType<
     type: Array as PropType<
@@ -44,7 +45,8 @@ onMounted(async () => {
     safeAreaInsets.value = res.safeAreaInsets
     safeAreaInsets.value = res.safeAreaInsets
     // 获取到tabbar的dom计算过的margin
     // 获取到tabbar的dom计算过的margin
     if (tabbar.value) {
     if (tabbar.value) {
-      tabbar.value.style.marginBottom = `${safeAreaInsets.value.bottom + 14}px`
+      // tabbar.value.style.marginBottom = `${safeAreaInsets.value.bottom + 14}px`
+      tabbar.value.style.marginBottom = addUnit(safeAreaInsets.value.bottom)
     }
     }
   }
   }
 })
 })

+ 0 - 0
packages/ui/tsconfig.json


+ 0 - 8
packages/ui/types/shims-uni.d.ts

@@ -1,8 +0,0 @@
-/// <reference types='@dcloudio/types' />
-import 'vue'
-
-declare module '@vue/runtime-core' {
-  type Hooks = App.AppInstance & Page.PageInstance
-
-  interface ComponentCustomOptions extends Hooks {}
-}