lc-tab-group

页签组,多用于tab切换的头部组件

效果

使用方法


<template>
<div class="demo">
<scroller class="scroller">
<title title="lc-tab-group"></title>
<category title="默认按钮组"></category>
<lc-tab-group :groups="groups" @changeTab="clickGroup" :tabIndex="2" style="margin-top:20px;"></lc-tab-group>
<category title="自定义按钮组"></category>
<lc-tab-group :groups="groups" :tabStyles="tabStyles" style="margin-top:20px;"></lc-tab-group>

</scroller>
</div>
</template>

<script>
import Title from 'lighting-ui/packages/_mods/title.vue';
import Category from 'lighting-ui/packages/_mods/category.vue';
import LcTabGroup from 'lighting-ui/packages/lc-tab-group';

export default {
components: { Title, Category, LcTabGroup },
data(){
return {
groups:[
{ text: "业务公告" },
{ text: "定期公告" },
{ text: "法律文件" },
{ text: "新闻资讯" }
],
tabStyles:{
width: 580,
height: 80,
fontSize:28,
titleColor:'#ffffff', //默认文字颜色
activeColor:'#FFE273',//默认背景色 选中颜色
borderColor:'#f8a065',//边框颜色 选中背景色
}
}
},
methods:{
clickGroup(index){
console.log(index)
}
}
}
</script>
<style scoped>
</style>

可配置参数

Prop Type Required Default Description
groups Array Y 页签组内容
tabIndex Number N 0 默认选择第几个
tabStyles Object N 自定义样式 (注1)

注1: tabStyles

tabStyles:{
width: 580,
height: 80,
fontSize:28,
titleColor:'#f32e2e', //默认文字颜色
activeColor:'#f3e62e',//默认背景色 选中颜色
borderColor:'#f37d2e',//边框颜色 选中背景色
}

事件回调

@changeTab="clickGroup"