选项卡
v-tabs
组件用于将内容隐藏在可选项之后。这还可以用作页面的伪导航,其中选项卡是链接,选项卡项是内容。
用例
v-tabs
组件是 v-item-group 的样式扩展。它提供了一个易于使用的接口来组织内容组。
template
<template>
<v-tabs>
<v-tab>Item One</v-tab>
<v-tab>Item Two</v-tab>
<v-tab>Item Three</v-tab>
</v-tabs>
</template>
当使用 dark 属性和 不 提供自定义 color 时,v-tabs
组件会将其颜色默认为 _white_。
当使用包含必填输入字段的 v-tab-item
时,你必须使用 eager prop 来验证尚未显示的必填字段。
API
从下面选择您想要的组件,并查看可用的属性、插槽、事件和函数。
实战场
template script
<template>
<div>
<v-row
justify="space-around"
>
<v-switch
v-model="icons"
class="mx-2"
label="Text + icons"
></v-switch>
<v-switch
v-model="centered"
class="mx-2"
label="Centered"
:disabled="vertical"
></v-switch>
<v-switch
v-model="grow"
class="mx-2"
label="Grow"
></v-switch>
<v-switch
v-model="vertical"
class="mx-2"
label="Vertical"
></v-switch>
<v-switch
v-model="right"
class="mx-2"
label="Right"
></v-switch>
<v-col cols="12">
<v-slider
v-model="tabs"
min="0"
max="10"
label="Tabs number"
></v-slider>
</v-col>
</v-row>
<v-tabs
v-model="tab"
background-color="deep-purple accent-4"
class="elevation-2"
dark
:centered="centered"
:grow="grow"
:vertical="vertical"
:right="right"
:prev-icon="prevIcon ? 'mdi-arrow-left-bold-box-outline' : undefined"
:next-icon="nextIcon ? 'mdi-arrow-right-bold-box-outline' : undefined"
:icons-and-text="icons"
>
<v-tabs-slider></v-tabs-slider>
<v-tab
v-for="i in tabs"
:key="i"
:href="`#tab-${i}`"
>
Tab {{ i }}
<v-icon v-if="icons">mdi-phone</v-icon>
</v-tab>
<v-tab-item
v-for="i in tabs"
:key="i"
:value="'tab-' + i"
>
<v-card
flat
tile
>
<v-card-text>{{ text }}</v-card-text>
</v-card>
</v-tab-item>
</v-tabs>
</div>
</template>
<script>
export default {
data () {
return {
tab: null,
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
icons: false,
centered: false,
grow: false,
vertical: false,
prevIcon: false,
nextIcon: false,
right: false,
tabs: 3,
}
},
}
</script>
示例
下面是一些简单到复杂的例子。
固定选项卡
fixed-tabs 属性强制 v-tab
占用所有可用空间,直到最大宽度(300px)。
template
<template>
<v-tabs
fixed-tabs
background-color="indigo"
dark
>
<v-tab>
Option
</v-tab>
<v-tab>
Another Selection
</v-tab>
<v-tab>
Items
</v-tab>
<v-tab>
Another Screen
</v-tab>
</v-tabs>
</template>
居中活动选项卡
活动选项卡总是居中
template
<template>
<v-card>
<v-tabs
background-color="deep-purple accent-4"
center-active
dark
>
<v-tab>One</v-tab>
<v-tab>Two</v-tab>
<v-tab>Three</v-tab>
<v-tab>Four</v-tab>
<v-tab>Five</v-tab>
<v-tab>Six</v-tab>
<v-tab>Seven</v-tab>
<v-tab>Eight</v-tab>
<v-tab>Nine</v-tab>
<v-tab>Ten</v-tab>
<v-tab>Eleven</v-tab>
<v-tab>Twelve</v-tab>
<v-tab>Thirteen</v-tab>
<v-tab>Fourteen</v-tab>
<v-tab>Fifteen</v-tab>
<v-tab>Sixteen</v-tab>
<v-tab>Seventeen</v-tab>
<v-tab>Eighteen</v-tab>
<v-tab>Nineteen</v-tab>
<v-tab>Twenty</v-tab>
</v-tabs>
</v-card>
</template>
选项卡项目
v-tabs-items
组件允许你自定义每个标签的内容。使用共享的 v-model
,v-tabs-items
将与当前选择的 v-tab
同步。
template script
<template>
<v-card>
<v-tabs
v-model="tab"
background-color="primary"
dark
>
<v-tab
v-for="item in items"
:key="item.tab"
>
{{ item.tab }}
</v-tab>
</v-tabs>
<v-tabs-items v-model="tab">
<v-tab-item
v-for="item in items"
:key="item.tab"
>
<v-card flat>
<v-card-text>{{ item.content }}</v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
tab: null,
items: [
{ tab: 'One', content: 'Tab 1 Content' },
{ tab: 'Two', content: 'Tab 2 Content' },
{ tab: 'Three', content: 'Tab 3 Content' },
{ tab: 'Four', content: 'Tab 4 Content' },
{ tab: 'Five', content: 'Tab 5 Content' },
{ tab: 'Six', content: 'Tab 6 Content' },
{ tab: 'Seven', content: 'Tab 7 Content' },
{ tab: 'Eight', content: 'Tab 8 Content' },
{ tab: 'Nine', content: 'Tab 9 Content' },
{ tab: 'Ten', content: 'Tab 10 Content' },
],
}
},
}
</script>
扩大
grow 属性将使选项卡项目占用所有可用空间,最大宽度为 300px。
template script style
<template>
<v-card color="basil">
<v-card-title class="text-center justify-center py-6">
<h1 class="font-weight-bold display-3 basil--text">BASiL</h1>
</v-card-title>
<v-tabs
v-model="tab"
background-color="transparent"
color="basil"
grow
>
<v-tab
v-for="item in items"
:key="item"
>
{{ item }}
</v-tab>
</v-tabs>
<v-tabs-items v-model="tab">
<v-tab-item
v-for="item in items"
:key="item"
>
<v-card
color="basil"
flat
>
<v-card-text>{{ text }}</v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
tab: null,
items: [
'Appetizers', 'Entrees', 'Deserts', 'Cocktails',
],
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}
},
}
</script>
<style>
/* Helper classes */
.basil {
background-color: #FFFBE6 !important;
}
.basil--text {
color: #356859 !important;
}
</style>
分页
如果选项卡项目超出其容器,则分页控件将出现在桌面设备。 对于移动设备,箭头将仅与 show-arrows 属性一起显示。
template
<template>
<v-card>
<v-tabs
dark
background-color="teal darken-3"
show-arrows
>
<v-tabs-slider color="teal lighten-3"></v-tabs-slider>
<v-tab
v-for="i in 30"
:key="i"
:href="'#tab-' + i"
>
Item {{ i }}
</v-tab>
</v-tabs>
</v-card>
</template>
自定义图标
prev-icon 和* next-icon* 可以用来设置分页器的自定义图标
template
<template>
<v-sheet elevation="6">
<v-tabs
background-color="cyan"
dark
next-icon="mdi-arrow-right-bold-box-outline"
prev-icon="mdi-arrow-left-bold-box-outline"
show-arrows
>
<v-tabs-slider color="yellow"></v-tabs-slider>
<v-tab
v-for="i in 30"
:key="i"
:href="'#tab-' + i"
>
Item {{ i }}
</v-tab>
</v-tabs>
</v-sheet>
</template>
垂直选项卡
标签可以切换为垂直堆叠其 v-tab
组件。
template
<template>
<v-card>
<v-toolbar flat color="primary" dark>
<v-toolbar-title>User Profile</v-toolbar-title>
</v-toolbar>
<v-tabs vertical>
<v-tab>
<v-icon left>mdi-account</v-icon>
Option 1
</v-tab>
<v-tab>
<v-icon left>mdi-lock</v-icon>
Option 2
</v-tab>
<v-tab>
<v-icon left>mdi-access-point</v-icon>
Option 3
</v-tab>
<v-tab-item>
<v-card flat>
<v-card-text>
<p>
Sed aliquam ultrices mauris. Donec posuere vulputate arcu. Morbi ac felis. Etiam feugiat lorem non metus. Sed a libero.
</p>
<p>
Nam ipsum risus, rutrum vitae, vestibulum eu, molestie vel, lacus. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Aliquam lobortis. Aliquam lobortis. Suspendisse non nisl sit amet velit hendrerit rutrum.
</p>
<p class="mb-0">
Phasellus dolor. Fusce neque. Fusce fermentum odio nec arcu. Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, quam. Phasellus blandit leo ut odio.
</p>
</v-card-text>
</v-card>
</v-tab-item>
<v-tab-item>
<v-card flat>
<v-card-text>
<p>
Morbi nec metus. Suspendisse faucibus, nunc et pellentesque egestas, lacus ante convallis tellus, vitae iaculis lacus elit id tortor. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Nunc sed turpis.
</p>
<p>
Suspendisse feugiat. Suspendisse faucibus, nunc et pellentesque egestas, lacus ante convallis tellus, vitae iaculis lacus elit id tortor. Proin viverra, ligula sit amet ultrices semper, ligula arcu tristique sapien, a accumsan nisi mauris ac eros. In hac habitasse platea dictumst. Fusce ac felis sit amet ligula pharetra condimentum.
</p>
<p>
Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Nam commodo suscipit quam. In consectetuer turpis ut velit. Sed cursus turpis vitae tortor. Aliquam eu nunc.
</p>
<p>
Etiam ut purus mattis mauris sodales aliquam. Ut varius tincidunt libero. Aenean viverra rhoncus pede. Duis leo. Fusce fermentum odio nec arcu.
</p>
<p class="mb-0">
Donec venenatis vulputate lorem. Aenean viverra rhoncus pede. In dui magna, posuere eget, vestibulum et, tempor auctor, justo. Fusce commodo aliquam arcu. Suspendisse enim turpis, dictum sed, iaculis a, condimentum nec, nisi.
</p>
</v-card-text>
</v-card>
</v-tab-item>
<v-tab-item>
<v-card flat>
<v-card-text>
<p>
Fusce a quam. Phasellus nec sem in justo pellentesque facilisis. Nam eget dui. Proin viverra, ligula sit amet ultrices semper, ligula arcu tristique sapien, a accumsan nisi mauris ac eros. In dui magna, posuere eget, vestibulum et, tempor auctor, justo.
</p>
<p class="mb-0">
Cras sagittis. Phasellus nec sem in justo pellentesque facilisis. Proin sapien ipsum, porta a, auctor quis, euismod ut, mi. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nam at tortor in tellus interdum sagittis.
</p>
</v-card-text>
</v-card>
</v-tab-item>
</v-tabs>
</v-card>
</template>
图标和文本
v-tab
可以包含图标和文本。这将 v-tabs
的高度增加到 72px。
template script
<template>
<v-card>
<v-tabs
v-model="tab"
background-color="deep-purple accent-4"
centered
dark
icons-and-text
>
<v-tabs-slider></v-tabs-slider>
<v-tab href="#tab-1">
Recents
<v-icon>mdi-phone</v-icon>
</v-tab>
<v-tab href="#tab-2">
Favorites
<v-icon>mdi-heart</v-icon>
</v-tab>
<v-tab href="#tab-3">
Nearby
<v-icon>mdi-account-box</v-icon>
</v-tab>
</v-tabs>
<v-tabs-items v-model="tab">
<v-tab-item
v-for="i in 3"
:key="i"
:value="'tab-' + i"
>
<v-card flat>
<v-card-text>{{ text }}</v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
tab: null,
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}
},
}
</script>
Charcoal Vuetify Beanie
Stay warm with the new Premium Knit Vuetify Beanie available in black, navy and charcoal.
ads by Vuetify
](https://store.vuetifyjs.com/product/premium-charcoal-vuetify-beanie?ref=vuetifyjs.com)
右对齐选项卡
right属性将选项卡向右对齐。
template
<template>
<v-card>
<v-tabs
background-color="white"
color="deep-purple accent-4"
right
>
<v-tab>Landscape</v-tab>
<v-tab>City</v-tab>
<v-tab>Abstract</v-tab>
<v-tab-item
v-for="n in 3"
:key="n"
>
<v-container fluid>
<v-row>
<v-col
v-for="i in 6"
:key="i"
cols="12"
md="4"
>
<v-img
:src="`https://picsum.photos/500/300?image=${i * n * 5 + 10}`"
:lazy-src="`https://picsum.photos/10/6?image=${i * n * 5 + 10}`"
aspect-ratio="1"
></v-img>
</v-col>
</v-row>
</v-container>
</v-tab-item>
</v-tabs>
</v-card>
</template>
内容
通常把 v-tabs
放在 v-toolbar
的 extension 插槽内。使用 v-toolbar
的 tabs 属性自动调整其高度为 48px,以匹配 v-tabs
。
template script
<template>
<v-card>
<v-toolbar
color="cyan"
dark
flat
>
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<v-toolbar-title>Page title</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon>
<v-icon>mdi-magnify</v-icon>
</v-btn>
<v-btn icon>
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
<template v-slot:extension>
<v-tabs
v-model="model"
centered
slider-color="yellow"
>
<v-tab
v-for="i in 3"
:key="i"
:href="`#tab-${i}`"
>
Item {{ i }}
</v-tab>
</v-tabs>
</template>
</v-toolbar>
<v-tabs-items v-model="model">
<v-tab-item
v-for="i in 3"
:key="i"
:value="`tab-${i}`"
>
<v-card flat>
<v-card-text v-text="text"></v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
model: 'tab-2',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}
},
}
</script>
与工具栏标题对齐选项卡
将 v-tabs
与 v-toolbar-title
组件对齐(v-toolbar
中必须使用 v-app-bar-nav-icon
或 v-btn
)。
template script
<template>
<v-card>
<v-toolbar
color="cyan"
dark
flat
>
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<v-toolbar-title>Your Dashboard</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon>
<v-icon>mdi-magnify</v-icon>
</v-btn>
<v-btn icon>
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
<template v-slot:extension>
<v-tabs
v-model="tab"
align-with-title
>
<v-tabs-slider color="yellow"></v-tabs-slider>
<v-tab v-for="item in items" :key="item">
{{ item }}
</v-tab>
</v-tabs>
</template>
</v-toolbar>
<v-tabs-items v-model="tab">
<v-tab-item
v-for="item in items"
:key="item"
>
<v-card flat>
<v-card-text v-text="text"></v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
tab: null,
items: [
'web', 'shopping', 'videos', 'images', 'news',
],
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}
},
}
</script>
动态选项卡
选项卡可以动态添加和删除。 这使您可以更新为任意数量,并且 v-tabs
组件会做出反应。 在此示例中,当我们添加新标签时,我们会自动更改模型以使其匹配。 随着我们添加更多标签并溢出容器,所选项目将自动滚动到视图中。 删除所有的 v-tabs
,滑块将消失。
template script
<template>
<v-card>
<v-tabs
v-model="tab"
background-color="red lighten-2"
dark
>
<v-tab
v-for="n in length"
:key="n"
>
Item {{ n }}
</v-tab>
</v-tabs>
<v-card-text class="text-center">
<v-btn text @click="length--">Remove Tab</v-btn>
<v-divider class="mx-4" vertical></v-divider>
<v-btn text @click="length++">Add Tab</v-btn>
</v-card-text>
</v-card>
</template>
<script>
export default {
data: () => ({
length: 15,
tab: null,
}),
watch: {
length (val) {
this.tab = val - 1
},
},
}
</script>
搜索框
更改 v-tab-item
时,内容区域将平滑缩放到新的大小。
template script
<template>
<v-card>
<v-toolbar
color="purple"
dark
flat
prominent
>
<v-text-field
append-icon="mic"
class="mx-4"
flat
hide-details
label="Search"
prepend-inner-icon="search"
solo-inverted
></v-text-field>
<template v-slot:extension>
<v-tabs
v-model="tabs"
centered
>
<v-tab
v-for="n in 3"
:key="n"
>
Item {{ n }}
</v-tab>
</v-tabs>
</template>
</v-toolbar>
<v-tabs-items v-model="tabs">
<v-tab-item>
<v-card flat>
<v-card-text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</v-card-text>
</v-card>
</v-tab-item>
<v-tab-item>
<v-card flat>
<v-card-title class="headline">An awesome title</v-card-title>
<v-card-text>
<p>
Duis lobortis massa imperdiet quam. Donec vitae orci sed dolor rutrum auctor. Vestibulum facilisis, purus nec pulvinar iaculis, ligula mi congue nunc, vitae euismod ligula urna in dolor. Praesent congue erat at massa.
</p>
<p>
Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Pellentesque egestas, neque sit amet convallis pulvinar, justo nulla eleifend augue, ac auctor orci leo non est. Etiam sit amet orci eget eros faucibus tincidunt. Donec sodales sagittis magna.
</p>
<p class="mb-0">
Ut leo. Suspendisse potenti. Duis vel nibh at velit scelerisque suscipit. Fusce pharetra convallis urna.
</p>
</v-card-text>
</v-card>
</v-tab-item>
<v-tab-item>
<v-card flat>
<v-card-title class="headline">An even better title</v-card-title>
<v-card-text>
<p>
Maecenas ullamcorper, dui et placerat feugiat, eros pede varius nisi, condimentum viverra felis nunc et lorem. Sed hendrerit. Maecenas malesuada. Vestibulum ullamcorper mauris at ligula. Proin faucibus arcu quis ante.
</p>
<p class="mb-0">
Etiam vitae tortor. Curabitur ullamcorper ultricies nisi. Sed magna purus, fermentum eu, tincidunt eu, varius ut, felis. Aliquam lobortis. Suspendisse potenti.
</p>
</v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
tabs: null,
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}
},
}
</script>
桌面选项卡
你可以用单个图标来表示 v-tab
的操作。当很容易将内容与每个选项卡关联起来时,这是很有用的。
template script
<template>
<v-card>
<v-toolbar flat>
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<v-toolbar-title>Contact Database</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon>
<v-icon>mdi-magnify</v-icon>
</v-btn>
<v-btn icon>
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
<template v-slot:extension>
<v-tabs
v-model="tabs"
fixed-tabs
>
<v-tabs-slider></v-tabs-slider>
<v-tab
href="#mobile-tabs-5-1"
class="primary--text"
>
<v-icon>mdi-phone</v-icon>
</v-tab>
<v-tab
href="#mobile-tabs-5-2"
class="primary--text"
>
<v-icon>mdi-heart</v-icon>
</v-tab>
<v-tab
href="#mobile-tabs-5-3"
class="primary--text"
>
<v-icon>mdi-account-box</v-icon>
</v-tab>
</v-tabs>
</template>
</v-toolbar>
<v-tabs-items v-model="tabs">
<v-tab-item
v-for="i in 3"
:key="i"
:value="'mobile-tabs-5-' + i"
>
<v-card flat>
<v-card-text v-text="text"></v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data () {
return {
tabs: null,
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}
},
}
</script>
带菜单
您可以使用菜单来保存额外的选项卡,动态地将它们交换出来。
template script
<template>
<v-card>
<v-toolbar
color="deep-purple accent-4"
dark
flat
>
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<v-toolbar-title>Page title</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon>
<v-icon>mdi-magnify</v-icon>
</v-btn>
<v-btn icon>
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
<template v-slot:extension>
<v-tabs
v-model="currentItem"
fixed-tabs
slider-color="white"
>
<v-tab
v-for="item in items"
:key="item"
:href="'#tab-' + item"
>
{{ item }}
</v-tab>
<v-menu
v-if="more.length"
bottom
left
>
<template v-slot:activator="{ on }">
<v-btn
text
class="align-self-center mr-4"
v-on="on"
>
more
<v-icon right>mdi-menu-down</v-icon>
</v-btn>
</template>
<v-list class="grey lighten-3">
<v-list-item
v-for="item in more"
:key="item"
@click="addItem(item)"
>
{{ item }}
</v-list-item>
</v-list>
</v-menu>
</v-tabs>
</template>
</v-toolbar>
<v-tabs-items v-model="currentItem">
<v-tab-item
v-for="item in items.concat(more)"
:key="item"
:value="'tab-' + item"
>
<v-card flat>
<v-card-text>
<h2>{{ item }}</h2>
{{ text }}
</v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
</v-card>
</template>
<script>
export default {
data: () => ({
currentItem: 'tab-Web',
items: [
'Web', 'Shopping', 'Videos', 'Images',
],
more: [
'News', 'Maps', 'Books', 'Flights', 'Apps',
],
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
}),
methods: {
addItem (item) {
const removed = this.items.splice(0, 1)
this.items.push(
...this.more.splice(this.more.indexOf(item), 1)
)
this.more.push(...removed)
this.$nextTick(() => { this.currentItem = 'tab-' + item })
},
},
}
</script>