Skip to content

Tabs Tab Panel

An in-page multi-view switching system. Supports swipe switching, lazy loading, KeepAlive cache, Sticky positioning, and dynamic tab add/remove.

Basic Usage

vue
<template>
  <see-tabs v-model="activeTab">
    <see-tab-pane name="tab1" title="Tab One">Content One</see-tab-pane>
    <see-tab-pane name="tab2" title="Tab Two">Content Two</see-tab-pane>
  </see-tabs>
</template>

<script setup>
import { ref } from 'vue'
const activeTab = ref('tab1')
</script>

Card Style

vue
<template>
  <see-tabs v-model="activeTab" type="card">
    <see-tab-pane name="tab1" title="Option 1">Content One</see-tab-pane>
    <see-tab-pane name="tab2" title="Option 2">Content Two</see-tab-pane>
  </see-tabs>
</template>

Badge/Dot

vue
<template>
  <see-tabs v-model="activeTab">
    <see-tab-pane name="tab1" title="Messages" :badge="99">Message List</see-tab-pane>
    <see-tab-pane name="tab2" title="Notifications" :dot="true">Notification List</see-tab-pane>
  </see-tabs>
</template>

Closable Tabs

vue
<template>
  <see-tabs v-model="activeTab" @on-close="onClose">
    <see-tab-pane name="tab1" title="Tab One" :closable="true">Content One</see-tab-pane>
    <see-tab-pane name="tab2" title="Tab Two" :closable="true">Content Two</see-tab-pane>
  </see-tabs>
</template>

Props (Tabs)

PropertyTypeDefaultDescription
modelValuestring | number''Currently active tab name
type'line' | 'card' | 'button''line'Tab style type
isSwipeablebooleanfalseWhether swipe switching is enabled
isStickybooleanfalseWhether to use sticky positioning
stickyOffsetTopnumber0Sticky offset top
durationnumber300Switch animation duration (ms)
isScrollablebooleanfalseWhether tab bar is scrollable
lineWidthnumber40Indicator width (px)
lineHeightnumber4Indicator height (px)
activeColorstring''Color when active
inactiveColorstring''Color when inactive
bgColorstring''Custom background color
isLazybooleanfalseWhether to enable lazy loading. When on, a pane's content is mounted only the first time it becomes active
isCachebooleanfalseWhether to enable cache (KeepAlive-like). When on, a pane stays mounted after first activation and uses v-show to toggle visibility, preserving its state across switches

Props (TabPane)

PropertyTypeDefaultDescription
namestring | number-Unique identifier (required)
titlestring''Tab title
isDisabledbooleanfalseWhether disabled
badgestring | number-Badge content
dotbooleanfalseWhether to show red dot
iconstring''Icon name
closablebooleanfalseWhether closable

Events (Tabs)

EventParametersDescription
onChangename, titleTab switch
onClickname, titleTab click (before switch)
onClosenameTab close
update:modelValuevaluev-model update

Expose (Tabs)

MethodParametersDescription
switchTonameSwitch to specified tab
addTabtabAdd tab
removeTabnameRemove tab
scrollToTabnameScroll to specified tab

Slots (TabPane)

Slot NameDescription
defaultTab content

Liao ICP No. 2025070134