Skip to content
本页目录

GicTab 标签

用法

使用 card 二次封装的标签页组件

基本用法

组件演示

示例
vue
<template>
  <div>
    <gicTab :tabList="tabList" v-model:activeKey="activeKey" @tab-change="tabChange" ref="tabs">
      <template #customTab="{ item }">
        <span>{{ item.label }}</span>
      </template>
    </gicTab>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { GicTab } from 'ctj-ui-next'
const tabList = ref<any>([
  {
    key: '1',
    label: '未提交',
  },
  {
    key: '2',
    label: '已提交',
  },
])
const tabs = ref()
const activeKey = ref<string>('2')
const tabChange = (val: any) => {
  console.log('val:', val)
  console.log('tabs.value:', tabs.value.activeTab) //当没有传activeKey时可使用该方法获取当前选中的页签的key
}
</script>
<template>
  <div>
    <gicTab :tabList="tabList" v-model:activeKey="activeKey" @tab-change="tabChange" ref="tabs">
      <template #customTab="{ item }">
        <span>{{ item.label }}</span>
      </template>
    </gicTab>
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { GicTab } from 'ctj-ui-next'
const tabList = ref<any>([
  {
    key: '1',
    label: '未提交',
  },
  {
    key: '2',
    label: '已提交',
  },
])
const tabs = ref()
const activeKey = ref<string>('2')
const tabChange = (val: any) => {
  console.log('val:', val)
  console.log('tabs.value:', tabs.value.activeTab) //当没有传activeKey时可使用该方法获取当前选中的页签的key
}
</script>

属性 Props

参数说明类型可选值默认值
activeKey默认选中的页签string默认选中第一个页签
tabList页签数据PropType<TabPane[]>

事件 Events

事件名说明回调参数
tab-changeactiveName 改变时触发(val:string)

插槽 Slots

插槽名参数说明
customTab{item 当前页签}当显示的页签不是 item.tab 时可自定义传入插槽

预算单位软件产品开发部