Skip to content
On this page

是否滚动

通过 scroll 开启

html
<uv-tab :list="list2" scroll/>

修改下划线样式

通过 lineHeight 修改线条高度,通过 lineColor 修改线条颜色

html
<uv-tab line-height="6px" line-color="#07c160" :list="list1"/>

收缩布局

通过 shrink 开启

html
<uv-tab shrink :list="list1"/>

标签属性

通过 color 修改默认字体颜色,通过 activeColor 修改活跃时字体颜色,通过 bgColor 修改tab栏的背景颜色

html
<uv-tab bg-color="#07c160" active-color="#fff" :list="list1"/>

初始化活跃子项,父组件改变子组件也会改变

通过 acitveIndex 进行绑定

html
<uv-tab :acitve-index="acitveIndex" :list="list1"/>

props

属性含义类型默认值
acitveIndex当前活跃子项indexNumber0
bgColor背景颜色String-
color默认子项颜色String-
activeColor活跃子项的颜色String-
scroll是否可以滚动,很多子项时可以开启Booleanfalse
lineHeight线条高度String-
lineColor线条颜色String-
list渲染列表Array-
shrink是否收缩布局Booleanfalse

events

事件名称含义参数
change改变子项当前活跃的index

css变量

css
--uv-tab-bg-color: #ffffff;
  --uv-tab-font-size: 14px;
  --uv-tab-height: 44px;
  --uv-tab-padding: 0 12px;
  --uv-tab-line-bg-color: #1989fa;
  --uv-tab-line-height: 3px;
  --uv-tab-border-radius: 3px;
  --uv-tab-item-color: #646566;
  --uv-tab-acitve-item-color: #323233;
  --uv-tab-acitve-item-font-weight: 700;
  --uv-tab-item-margin: 10px;

Released under the MIT License.