优化代码
This commit is contained in:
parent
846939817a
commit
f68fbe2e2a
@ -12,8 +12,8 @@
|
||||
<view class="scroll-box" :class="{'tabs-scorll-flex': !isScroll}">
|
||||
<view class="tab-item line1" :id="'tab-item-' + index" v-for="(item, index) in list"
|
||||
:key="index" @tap="clickTab(index)" :style="[tabItemStyle(index)]">
|
||||
<u-badge :count="item[count] || item['dot'] || 0" :offset="offset" size="mini"></u-badge>
|
||||
{{ item[name] || item['name']}}
|
||||
<u-badge :count="item[count] || item['dot'] || 0" :offset="offset" size="mini" class="badge"></u-badge>
|
||||
{{ item[name] || item['name']}}
|
||||
</view>
|
||||
<view v-if="showBar" class="tab-bar" :style="[tabBarStyle]"></view>
|
||||
</view>
|
||||
@ -376,4 +376,11 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: 8rpx;
|
||||
left: 80%;
|
||||
transform: translateX(-80%);
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user