DateTab.vue
1.08 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
<template>
<div class="date-tab-box">
<div v-for="(item, index) in dateList" :key="index" class="tab-item" :class="tabActive == index ? 'tab-item-active' : ''" @click="changeDate(index)">{{ item }}</div>
</div>
</template>
<script>
export default {
name: 'DateTab',
props: {
dateList: {
type: Array,
default: () => []
}
},
data() {
return {
tabActive: 1,
nearThreeMonth: '',
nearSixMonth: '',
nearOneYear: ''
}
},
created() {},
methods: {
changeDate(val) {
this.tabActive = val
this.$emit('changeDate', val)
}
}
}
</script>
<style lang="scss" scoped>
.date-tab-box {
display: flex;
// width: 17.62vw;
height: 3.56vh;
border: 2px solid;
border-image: linear-gradient(90deg, #074989, #30dcff, #074989) 1;
padding: 0.28vh;
box-sizing: border-box;
.tab-item {
font-weight: 400;
font-size: 12px;
color: #c9c9c9;
height: 2.67vh;
line-height: 2.67vh;
padding: 0 0.83vw;
}
.tab-item-active {
font-weight: 600;
color: #ffffff;
background: #244888;
}
}
</style>