layout.vue
2.54 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<template>
<Row type="flex" class-name="layout">
<Col :span="6" :class="menuLeftClass" class="layout-menu-left">
<PurviewMenu :class="menuClass"></PurviewMenu>
</Col>
<Col :span="18" class="layout-menu-right">
<UserInfo @menu-trigger="menuTrigger"></UserInfo>
<div class="layout-breadcrumb">
<Breadcrumbs></Breadcrumbs>
</div>
<div class="layout-content">
<router-view></router-view>
</div>
<div class="layout-copy">
2011-2016 © YOHO集团
</div>
</Col>
</Row>
</template>
<script>
export default {
name: 'layout',
data() {
return {
menuClass: {
'menu-collapse': false
},
menuLeftClass: {
'left-collapse': false
}
};
},
methods: {
menuTrigger() {
this.menuClass['menu-collapse'] = !this.menuClass['menu-collapse'];
this.menuLeftClass['left-collapse'] = !this.menuLeftClass['left-collapse'];
}
}
};
</script>
<style lang="scss">
body {
color: #444;
}
.layout {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
min-width: 800px;
.layout-menu-left {
background: #464c5b;
min-width: 170px;
max-width: 250px;
&.left-collapse {
width: 50px;
min-width: initial;
}
}
.layout-menu-right {
flex: 1;
display: flex;
flex-flow: column;
.layout-breadcrumb {
padding: 10px 15px 0;
}
.layout-content {
min-height: 200px;
padding: 25px;
overflow-y: scroll;
background: #fff;
border-radius: 4px;
flex: 1;
}
.layout-copy {
text-align: center;
padding: 10px 0 20px;
color: #9ea7b4;
}
}
.clear-fixed {
clear: both;
}
}
.layout-logo-left {
width: 90%;
height: 30px;
border-radius: 3px;
background-image: url(../images/logo.png);
background-repeat: no-repeat;
margin: 15px auto;
}
.layout-ceiling-main a {
color: #9ba7b5;
}
.layout-hide-text .layout-text {
display: none;
}
.ivu-col {
transition: width .2s ease-in-out;
}
.ivu-menu-item-group-title {
color: #9ea7b4 !important;
}
.ivu-menu-item {
color: #fff !important;
}
</style>