Skip to content
On this page

自定义颜色

通过 activeColor 设置

html
<uv-tab-bar active-color="green" v-model="active1">
  <uv-tab-bar-item
    v-for="item in list"
    :key="item.name"
    :icon-size="item.iconSize"
    :icon-name="item.iconName"
    :text="item.name"
  />
</uv-tab-bar>

tab-bar-item插槽

通过插槽名为 icon 自定义图标,通过插槽名为 text 自定义文字效果

html
<uv-tab-bar :fixed="false" active-color="green" v-model="active1">
 <uv-tab-bar-item v-for="item in 3" :key="item">
   <template #icon>
     icon
   </template>
   <template #text>
     text
   </template>
 </uv-tab-bar-item>
</uv-tab-bar>

tab-bar props

属性含义类型默认值
modelValue双向绑定当前子项index[Number, String]-
zIndex层级[Number, String]999
bgColor背景颜色String'#fff'
activeColor活跃时文字颜色String#1989fa'
activeBgColor活跃时背景颜色String-
inactiveColor不活跃时文字颜色String'#7d7e80'
border是否显示边框Booleantrue
borderColor边框颜色String'#eee'
fixed是否开启fixed定位Booleantrue
placeholder是否生成等高占位元素Booleanfalse

tab-bar events

事件名称含义参数
change子项改变时-

tab-bar css变量

css
--uv-tab-bar-height: 50px;

tab-bar-item props

属性含义类型默认值
iconSize图标大小[String,Number]-
iconName图标名称String-
iconProps图标配置Object-
text文字名称String-

tab-bar css变量

css
--uv-tab-bar-item-font-size: 12px;
  --uv-tab-bar-item-text-margin-top: 5px;

Released under the MIT License.