# Tab 标签

# 使用指南

# 规则

  • 标签数量,一般控制2-5个
  • 标签中的文案需要精简,一般2-4个字
  • 最多设置5个选项,超过的选项可以滑动展示

# 代码演示

查看代码

# 与h3-mobile-vue组件的区别以及迁移

旧组件库组件存在重复组件,弃用了h3-tab-flow组件,并将其主要功能(多标签滚动)合并到h3-tab

为了更加灵活使用,移除了h3-tab-item内置的badge功能

若要做迁移请参考

  1. 弃用的props:lineWidth disabledColor customBarWidth animate height preventDefault activeClass badgeLabel badgeBackground badgeColor preventDefault

  2. 替换的props:

    • barActiveColor => lineColor
    • defaultColor => inactiveColor
    • borderBottom => border
  3. 新增的props:duration

  4. 弃用原来所有的事件

# API - H3Tab

# Props - H3Tab

参数 说明 类型 默认值
index 当前显示的 swipeItem 索引 或 item的 namev-model绑定值 string|number 0
activeColor 选中标签的颜色 string #107fff
inactiveColor 未选中标签的颜色 string #333333
lineColor 标签下划线的颜色 string #107fff
lineWidth 自定义下滑线宽度 string|number -
border 是否显示下边框 boolean true
duration 动画持续时间,单位 ms string|number 300

# Events - H3Tab

事件名 说明 参数
input v-model绑定事件 value:number|string
change 标签选择变化事件 value:number|string

# Function - H3Tab

  • 实例方法
方法名 说明 参数
refresh 刷新组件 -

# API - H3TabItem

# Props - H3TabItem

参数 说明 类型 默认值
name 标签名称,作为匹配的标识符 string -
disabled 是否可用 Boolean false

# Events - H3TabItem

事件名 说明 参数
click 点击触发事件 -