Appearance
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 | 右侧内容插槽 |