c_Tabbar.vue
1.73 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<template>
<div id="tabbar">
<div class="tab" :class="active=='service'?'active':''" @click="handleQYX">
<img v-if="active=='service'" src="@/assets/tabbar/tab1_on.png" alt="">
<img v-else src="@/assets/tabbar/tab1_off.png" alt="">
<p>浙里研学</p>
</div>
<div class="tab" :class="active=='grow'?'active':''" @click="handleGrowUp">
<img v-if="active=='grow'" src="@/assets/tabbar/tab2_on.png" alt="">
<img v-else src="@/assets/tabbar/tab2_off.png" alt="">
<p>成长记录</p>
</div>
<div class="tab" :class="active=='home'?'active':''" @click="handleHome">
<img v-if="active=='home'" src="@/assets/tabbar/tab3_on.png" alt="">
<img v-else src="@/assets/tabbar/tab3_off.png" alt="">
<p>我的</p>
</div>
</div>
</template>
<script>
export default {
name: 'Tabbar',
props: {
active: String
},
methods: {
handleQYX () {
this.$router.push({ name: 'Home'})
},
handleGrowUp () {
this.$router.push({ name: 'GrowUpRecord'})
},
handleHome(){
this.$router.push({ name: 'HomeYX'})
}
}
}
</script>
<style lang="scss" scoped>
#tabbar {
position: fixed;
bottom: 0;
width: 100%;
height: 100px;
background: #fff;
display: flex;
justify-content: space-around;
padding-bottom: 40px;
z-index: 99;
.tab {
padding: 18px;
img {
width: 46px;
display: block;
margin: 0 auto;
}
p {
font-size: 20px;
color: #999999;
text-align: center;
margin-top: 14px;
}
}
}
</style>
<style lang="scss">
// 长辈版
.elder {
#tabbar {
padding-top: 30px;
.tab{
padding: 0;
img{
width: 44px;
}
p{
font-size: 34px;
}
}
}
}
</style>