<template>
<view class="content">
<text>uni.showTabBarRedDot 测试:</text>
<button @click="onRedDot(0)">红点0</button>
<button @click="onRedDot(1)">红点1</button>
<button @click="onRedDot(2)">红点2</button>
<button @click="onRedDot(3)">红点3</button>
<button @click="onRedDot(4)">红点4</button>
<text>uni.setTabBarBadge 测试:</text>
<button @click="onRedDotText(0, '10')">提醒10</button>
<button @click="onRedDotText(1, '11')">提醒11</button>
<button @click="onRedDotText(2, '12')">提醒12</button>
<button @click="onRedDotText(3, '13')">提醒13</button>
<button @click="onRedDotText(4, '14')">提醒14</button>
</view>
</template>
<script>
export default {
methods: {
onRedDot(index) {
uni.showTabBarRedDot({ index });
},
onRedDotText(index, text) {
uni.setTabBarBadge({ index, text });
},
},
};
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>

- 发布:2021-11-18 20:06
- 更新:2021-12-06 11:54
- 阅读:443
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: macOS Big Sur 11.2.3
HBuilderX类型: 正式
HBuilderX版本号: 3.2.12
手机系统: Android
手机系统版本号: Android 12
手机厂商: 小米
手机机型: iPhone 12
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
真机运行即可
真机运行即可
预期结果:
红点正常显示
红点正常显示
实际结果:
最后一个tab 在安卓下不显示红点
最后一个tab 在安卓下不显示红点
bug描述:
uni.showTabBarRedDot 和 uni.setTabBarBadge 在设置最后一个的时候都会有问题
