forked from thomasbertet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTabsView.vue
executable file
·139 lines (135 loc) · 4.84 KB
/
TabsView.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<template lang="pug">
component-view(v-bind:doc="doc")
</template>
<script>
export default {
name: 'tabs-view',
data () {
return {
doc: {
component: 'tabs',
edit: 'TabsView',
title: 'Tabs',
desc: 'The <code>v-tabs</code> component is used for hiding content behind a selectable item. This can also be used as a pseudo-navigation for a page, where the tabs are links and the tab-items are the content.',
examples: [
{ header: 'Toolbar tabs', file: 'tabs/1', desc: 'The <code>v-tabs</code> component is highly customizable to suit your needs. You can get and set the currently active tab by using the <code>v-model</code> prop on the <code>v-tabs</code> component.' },
{ header: 'Centered tabs', file: 'tabs/2', desc: 'Tabs can be centered by using the <code>centered</code> prop. Here we have also applied the <code>fixed</code> prop which gives all tab items a fixed size, regardless of content.' },
{ header: 'Content', file: 'tabs/3', desc: 'Tabs are not the only thing you can put inside the <code>v-tabs</code> component. In this example we\'ve also added a toolbar.' },
{ header: 'With search', file: 'tabs/4', desc: 'Here is another example of additional content inside the <code>v-tabs</code> component.' },
{ header: 'Icons', file: 'tabs/5', desc: 'By using the <code>icons</code> prop you can add icons to each tab item.' },
{ header: 'Desktop tabs', file: 'tabs/6' },
{ header: 'Grow', file: 'tabs/7', desc: 'The <code>grow</code> prop will make the tab items take up all available space.' },
{ header: 'Pagination', file: 'tabs/8', desc: 'If the tab items overflow their container, pagination controls will appear.' },
{ header: 'Disabled scroll', file: 'tabs/9', desc: 'You can disable the pagination controls by setting the <code>scrollable</code> prop to <code>false</code>. This also has the effect of removing the margins around the tab item container.' }
],
props: {
'v-tabs': {
shared: ['theme'],
params: [
[
'centered',
'Boolean',
'False',
'Centers the tabs'
],
[
'fixed',
'Boolean',
'False',
'Items have a fixed size'
],
[
'grow',
'Boolean',
'False',
'Items fill available space'
],
[
'icons',
'Boolean',
'False',
'Applies the tabs--icons class'
],
[
'scrollable',
'Boolean',
'True',
'Displays pagination controls when content overflows'
]
],
model: {
type: ['String'],
default: '-',
description: 'Current selected tab'
}
},
'v-tabs-bar': {
params: []
},
'v-tabs-item': {
shared: ['router'],
params: [
[
'activeClass',
'String',
'toolbar__item--active',
'Class to apply for the active toolbar item'
]
]
},
'v-tabs-content': {
params: [
[
'id',
'String',
'Required',
'The content id'
],
[
'transition',
'String',
'v-tab-transition',
'Sets the default transition'
],
[
'reverse-transition',
'String',
'v-tab-reverse-transition',
'Sets the reverse transition'
],
[
'lazy',
'Boolean',
'False',
'Will not render contents until is active for the first time'
]
]
}
},
functional: {
'v-tabs-bar': {
params: [
[
'v-tabs-slider',
'.tabs__slider'
]
]
},
},
events: {
'v-tabs': {
params: [
['input', 'String', 'Current active tab'],
]
},
}
}
}
}
}
</script>
<style lang="stylus">
#components-tabs-view
.tabs
margin: 1rem 0
</style>