调整徽标位置以避免遮挡,同时注释掉测试用的badge值
@@ -86,6 +86,7 @@ export const customTabbarList: CustomTabBarItem[] = [
text: '我的',
iconType: 'uniUi',
icon: 'contact',
+ // badge: 100,
},
// 其他类型演示
// 1、uiLib
@@ -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>