소스 검색

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

EvilDragon 3 달 전
부모
커밋
34de6d9255
4개의 변경된 파일6개의 추가작업 그리고 10개의 파일을 삭제
  1. 3 1
      packages/app/src/components/navbar-evo.vue
  2. 3 1
      packages/merchant/src/components/tabbar-evo.vue
  3. 0 0
      packages/ui/tsconfig.json
  4. 0 8
      packages/ui/types/shims-uni.d.ts

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

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

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

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