Skip to content

WtTabs

Props

NameTypeDefaultDescription
currentObject{}The value of the selected tab
tabsArray[]The list of tabs. Tracked by value property

Events

NameParamsDescription
changetab: ObjectReturns tab object from list of tabs

Slots

NameScopeDescription
:tab-value{ tab, current }Override tab contents with passed tab from tabs object and current tab

Example Tabs

Code
vue
<script setup>
import { ref } from 'vue';

const tabs = [
  {
    text: 'Tab 1',
    value: '1',
  },
  {
    text: 'Tab 2',
    value: '2',
  },
  {
    text: 'Tab 3',
    value: '3',
  },
];

const current = ref(tabs[0]);
</script>

<template>
  <wt-tabs
    :current="current"
    :tabs="tabs"
    @change="current = $event"
  />
</template>

<style scoped lang="scss"></style>

Example Wide Tabs

Code
vue
<script setup>
import { ref } from 'vue';

const tabs = [
  {
    text: 'Tab 1',
    value: '1',
  },
  {
    text: 'Tab 2',
    value: '2',
  },
  {
    text: 'Tab 3',
    value: '3',
  },
];

const current = ref(tabs[0]);
</script>

<template>
  <wt-tabs
    :current="current"
    :tabs="tabs"
    wide
    @change="current = $event"
  />
</template>

<style scoped lang="scss"></style>