-
Notifications
You must be signed in to change notification settings - Fork 12
/
Tabs.vue
106 lines (91 loc) · 2.22 KB
/
Tabs.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
<template>
<div class="secondary">
<ul class="tabs-component-tabs">
<li v-for="(tab, i) in tabs"
:key="i" :class="{ 'is-active': tab.isActive }"
class="tabs-component-tab">
<span @click="selectTab(tab.name, $event)" class="text foreground--text">{{ tab.name }}</span>
<v-icon size="13px" class="close-icon" color="white" @click="close(i)">close</v-icon>
</li>
<li class="tabs-component-tab remainder"></li>
</ul>
<div class="tabs-component-panels">
<slot/>
</div>
</div>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import BaseTabs from '@/components/BaseTabs.vue';
@Component
export default class Tabs extends BaseTabs { }
</script>
<style lang="sass" scoped>
$border: #111
.tabs-component-tabs
border: 0
padding: 0
align-items: stretch
display: flex
justify-content: flex-start
.tabs-component-tab
position: relative
color: #999
font-size: 14px
font-weight: 600
list-style: none
width: 150px
text-align: center
border-left: 1px solid $border
box-shadow: inset 0 -1px 0 $border
&.is-active
color: #000
box-shadow: unset
&:last-of-type
box-shadow: 1px 0 0 $border
&:before
content: ""
position: absolute
pointer-events: none
z-index: 2
top: 0
left: -1px
bottom: 0
width: 3px
background: #568af2
&:hover .close-icon
transform: scale(1)
transition-duration: .16s
.remainder
flex-grow: 1
border-left: none
.text
align-items: center
padding: .75em 1em
text-decoration: none
display: block
user-select: none
&:hover
cursor: default
.tabs-component-panels
box-shadow: 0 0 10px rgba(0, 0, 0, .05)
.close-icon
top: 0.75em
right: 0.5em
z-index: 2
width: 1.5em
height: 1.5em
line-height: 1.5
text-align: center
border-radius: 3px
overflow: hidden
transform: scale(0)
transition: transform .08s
position: absolute
&:hover
cursor: pointer
color: #001133
background-color: #568af2
transform: scale(1)
transition-duration: .16s
</style>