Tab.vue
1.05 KB
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
<template>
<div class="tab">
<div
:class="['tab-item',{ 'item-active': activeName == item.id }]"
v-for="item in tabList"
:key="item.id"
@click="$emit('update:activeName',item.id)"
>{{item.label}}</div>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
tabList: {
type: Array,
default: () => []
},
activeName: {
type: String,
default: ''
}
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.tab {
width: fit-content;
height: 38px;
border-radius: 4px;
background: #e8e8e8;
margin: 0 20px 21px;
border: 2px solid #e8e8e8;
display: flex;
align-items: center;
.tab-item {
padding: 0 24px;
display: flex;
height: 100%;
align-items: center;
font-size: 14px;
color: #666666;
cursor: pointer;
user-select: none;
transition: all .15s;
}
.item-active {
background-color: #fff;
color: #2A58AD;
border-radius: 3px;
}
}
</style>