-
Notifications
You must be signed in to change notification settings - Fork 68
/
App.vue
105 lines (101 loc) · 2.3 KB
/
App.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
<template>
<div id="app">
<div class="header">
<div class="title">全部赛事</div>
<div class="navigator">
<ul class="nav-list">
<li v-for="(item, index) in tabList" :key="index"
@click="switchTab(index)" :class="{active: currentPage === index}">
{{ item }}
</li>
</ul>
<div class="triangle-up" :class="{left: currentPage === 0, right: currentPage === 2}"></div>
</div>
</div>
<div class="content">
<cube-slide
:data="tabList"
:initialIndex="currentPage"
:loop="false"
:autoPlay="false"
:threshold="0.1"
@change="slideChange">
<cube-slide-item v-for="(item, index) in tabList" :key="index">
<div class="match-list-wrapper">
<match-list :type="index"></match-list>
</div>
</cube-slide-item>
<div slot="dots"></div>
</cube-slide>
</div>
</div>
</template>
<script>
import MatchList from './components/match-list'
export default {
name: 'app',
data () {
return {
currentPage: 1,
tabList: ['已结束', '直播中', '我的关注']
}
},
components: {
MatchList
},
methods: {
switchTab (index) {
this.currentPage = index
},
slideChange (index) {
this.currentPage = index
}
}
}
</script>
<style lang="stylus">
html, body, #app
height: 100%
text-align: center
#app
background-color: #E0E4E8
.header
color: white
background-color: #15191D
.title
padding: 20px 0
font-size: 16px
color: white
.navigator
position: relative
padding-bottom: 12px
font-size: 12px
.nav-list
display: flex
justify-content: space-around
li
width: 60px
color: #636873
&.active
color: white
.triangle-up
position: absolute
left: 50%
transform: translate(-50%, 0)
bottom: 0
width: 0
height: 0
border-left: 7px solid transparent
border-right: 7px solid transparent
border-bottom: 8px solid #E0E4E8
transition: all 0.4s
&.left
left: 16.67%
&.right
left: 83.34%
.content
height: calc(100% - 80px)
overflow: hidden
.match-list-wrapper
height: 100%
</style>