-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
75 lines (65 loc) · 1.27 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
<template>
<div id="app">
<nav class="page-side-menu">
<ul>
<li>
<router-link to="/">首页</router-link>
</li>
<li>
<router-link to="/about">关于</router-link>
</li>
</ul>
</nav>
<div class="page-container">
<router-view></router-view>
</div>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
defaultActive: '/'
}
},
mounted () {
this.defaultActive = this.$route.path
}
}
</script>
<style lang="less" rel="stylesheet/less">
body > #app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
display: flex;
width: 100%;
height: 100%;
padding-top: 40px;
box-sizing: border-box;
.page-side-menu {
flex: 0 0 200px;
ul {
display: flex;
flex-direction: column;
li {
flex: 1;
&:not(:last-child) {
padding-bottom: 10px;
}
}
}
}
.page-container {
flex: 1;
display: flex;
padding-left: 20px;
& > .page {
flex: 1;
display: flex;
}
}
}
</style>