-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.vue
112 lines (112 loc) · 2.26 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
106
107
108
109
110
111
112
<template>
<div class="container">
<header>
<h1>FlexTable</h1>
</header>
<div class="main">
<nav class="nav">
<ul>
<li v-for="item in routes" :key="item.name">
<router-link
:to="item.path"
:class="$route.name === item.name?'active':''"
>{{
(item.meta && item.meta.title) || item.name
}}</router-link>
</li>
</ul>
</nav>
<div class="cont">
<router-view></router-view>
</div>
</div>
</div>
</template>
<script>
import routes from "./routes";
export default {
data: function() {
return {
routes
};
}
};
</script>
<style lang="less">
body,
h1,
ul,
li {
padding: 0;
margin: 0;
}
.container {
min-height: 100vh;
display: flex;
flex-flow: column;
header {
padding: 10px;
flex-shrink: 0;
color: #fff;
text-align: center;
border-bottom: 2px solid #0e8cf3;
background: linear-gradient(to bottom, #1696ff, #16c9ff);
h1 {
font-weight: 600;
font-size: 28px;
line-height: 1;
}
}
}
.main {
flex: 1;
display: flex;
align-items: stretch;
position: relative;
}
.btn-box{
padding: 10px 0;
border-bottom: 1px solid #eee;
margin-bottom: 15px;
button{
padding: 5px 10px;
}
}
.nav {
padding: 15px 5px;
width: 170px;
border-right: 1px solid #d8d8d8;
flex-shrink: 0;
overflow-x: hidden;
overflow-y: auto;
background: #fcfcfc;
ul li{
list-style: none;
}
a{
color:#444;
text-decoration: none;
display: block;
line-height: 24px;
margin-bottom: 5px;
padding: 0 10px;
border-radius: 5px;
font-size: 12px;
&:hover{
color:#0e8cf3;
}
&.active{
background: #0e8cf3;
color:#fff;
&:hover{
color:#fff;
}
}
}
}
.cont {
padding: 20px;
width: 0;
flex: 1;
}
</style>