Skip to content

Commit

Permalink
feat: Tabs组件选中时增加一个active的class #595
Browse files Browse the repository at this point in the history
  • Loading branch information
jry committed Dec 30, 2024
1 parent 8e6c1cd commit bde56ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/uni_modules/uview-plus/components/u-tabs/u-tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
@longpress="longPressHandler(item,index)"
:ref="`u-tabs__wrapper__nav__item-${index}`"
:style="[addStyle(itemStyle), {flex: scrollable ? '' : 1}]"
:class="[`u-tabs__wrapper__nav__item-${index}`, item.disabled && 'u-tabs__wrapper__nav__item--disabled']"
:class="[`u-tabs__wrapper__nav__item-${index}`,
item.disabled && 'u-tabs__wrapper__nav__item--disabled',
innerCurrent == index ? 'u-tabs__wrapper__nav__item-active' : '']"
>
<slot v-if="$slots.content" name="content" :item="item" :keyName="keyName" :index="index" />
<slot v-else-if="!$slots.content && ($slots.default || $slots.$default)"
Expand Down

0 comments on commit bde56ee

Please sign in to comment.