Tab
Install

Install

如果需要监听tab-item的点击事件并取得索引,请使用on-item-click事件:

<tab>
  <tab-item @on-item-click="handler"></tab-item>
</tab>

tab

tab

Props

nametypedefaultdescriptionrequired version
line-widthnumber3line width--
active-colorstringselected text color--
default-colorstringdefault text color--
disabled-colorstringdisabled text color--
bar-active-colorstringactive color for bar--
animatebooleantruewhether use transition--
custom-bar-widthstring
function
set active bar width, like 50px. or you can use function, param is (currentInex)v2.1.1-rc.7
badge-labelstringbadge labelv2.3.5
badge-backgroundstringbadge background colorv2.3.5
badge-colorstringbadge font colorv2.3.5
prevent-defaultstringfalsewhether prevent auto-switching tab-item when tab-item is clickedv2.7.2
scroll-thresholdnumber4scroll tabs thresholdv2.8.1
bar-positionstringbottombar position, one of [bottom, top]. only works when animate is true.v2.9.0
tab-item

tab-item

Props

nametypedefaultdescriptionrequired version
disabledbooleanfalsewheher disabled clicking--
active-classstringactive classname for current tab-item--

Events

nameparamsdescriptionrequired version
@on-item-click(index)emits when current tabItem is clickedv2.2.1-rc.4
Variables

Variables

namedefaultdescriptioninherited name
@tab-text-disabled-color #ddd --
@tab-text-default-color #666 --
@tab-text-active-color #04BE02 --@theme-color
@tab-bar-active-color #04BE02 --@theme-color


Contributors

Contributors

Total commits quantity: 25,Total contributors quantity: 3

airyland万刚Kwan

Changelog

Releases

  • v2.9.1 [fix] fix box-sizing issue #2621. thanks to @suncodeer
  • v2.9.0 [feature] support prop:bar-position
  • v2.8.1 [feature] support prop:scroll-threshold
  • v2.7.2 [feature] support prop:prevent-default #2176
  • v2.3.5 [feature] Support badge #1513
  • v2.2.1-rc.4 [enhance] Support param:index on event:on-item-click
  • v2.1.1-rc.7 [feature] Support setting bar width with prop:custom-bar-width
  • v2.1.1-rc.7 [fix] Fix errors when initializing without tab-item #1038 @liu2010y
  • v2.1.0-rc.46 [feature] add prop:bar-active-color #715 @greedying