Skip to content

c-tabs 标签页

c-tabs 是对 uView 的 u-tabs 组件的封装,预设了通用的样式配置。

基础用法

vue
<template>
  <c-tabs :list="list" :current="current" @change="change"></c-tabs>
</template>

<script>
export default {
  data() {
    return {
      list: [{ name: '待付款' }, { name: '待发货' }, { name: '待收货' }],
      current: 0
    }
  },
  methods: {
    change(index) {
      this.current = index
    }
  }
}
</script>

Props

该组件支持 u-tabs 的所有 Props。

预设样式默认值:

参数说明默认值
lineWidth滑块宽度32rpx
lineHeight滑块高度6rpx
activeStyle激活项样式{ color: '#333333', fontSize: '32rpx', fontWeight: 600 }
inactiveStyle未激活项样式{ color: '#999999', fontSize: '32rpx' }
itemStyle每一项的样式{ padding: '16rpx' }

Events

支持 u-tabs 的所有事件,如 @change, @click 等。

Slots

插槽名说明
right右侧内容插槽