소스 검색

fix(tabbar): 调整徽标位置并注释掉测试代码

调整徽标位置以避免遮挡,同时注释掉测试用的badge值
feige996 8 달 전
부모
커밋
cd0c111fae
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      src/tabbar/config.ts
  2. 1 1
      src/tabbar/index.vue

+ 1 - 0
src/tabbar/config.ts

@@ -86,6 +86,7 @@ export const customTabbarList: CustomTabBarItem[] = [
     text: '我的',
     iconType: 'uniUi',
     icon: 'contact',
+    // badge: 100,
   },
   // 其他类型演示
   // 1、uiLib

+ 1 - 1
src/tabbar/index.vue

@@ -109,7 +109,7 @@ function getImageByIndex(index: number, item: CustomTabBarItem) {
                 <view class="absolute right-0 top-0 h-2 w-2 rounded-full bg-#f56c6c" />
               </template>
               <template v-else>
-                <view class="absolute right-0 top-0 box-border h-5 min-w-5 center rounded-full bg-#f56c6c px-1 text-center text-xs text-white">
+                <view class="absolute top-0 box-border h-5 min-w-5 center rounded-full bg-#f56c6c px-1 text-center text-xs text-white -right-3">
                   {{ item.badge > 99 ? '99+' : item.badge }}
                 </view>
               </template>