index.vue
1.89 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
<template>
<div class="layout-header">
<el-header class="platform-head fixed-header">
<div class="header-middle">
<!-- menu -->
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="1">处理中心</el-menu-item>
<el-menu-item index="2-1">选项1</el-menu-item>
<el-menu-item index="2-2">选项2</el-menu-item>
<el-menu-item index="2-3">选项3</el-menu-item>
<el-menu-item index="2-4-1">选项1</el-menu-item>
<el-menu-item index="2-4-2">选项2</el-menu-item>
<el-menu-item index="2-4-3">选项3</el-menu-item>
<el-menu-item index="3">消息中心</el-menu-item>
</el-menu>
</div>
<div class="header-left">logo</div>
<div class="header-right">right</div>
</el-header>
</div>
</template>
<script>
export default {
name: 'GlobalHeader',
data() {
return {
activeIndex: '1'
}
},
methods: {
handleSelect(key, keyPath) {
console.log(key, keyPath)
}
}
}
</script>
<style lang="scss" scoped>
.layout-header {
box-sizing: border-box;
flex: 0 0 auto;
}
.platform-head {
width: 100%;
background-color: #b3c0d1;
color: #fff;
height: 60px;
line-height: 60px;
padding: 0 500px 0 300px;
overflow: hidden;
&.fixed-header {
position: fixed;
top: 0;
right: 0;
z-index: 9;
}
}
.header-middle {
position: relative;
float: left;
width: 100%;
height: 60px;
}
.header-left {
position: relative;
float: left;
width: 300px;
height: inherit;
left: -300px;
margin-left: -100%;
background: #f00;
text-align: center;
}
.header-right {
position: relative;
float: left;
width: 500px;
height: inherit;
right: -500px;
margin-left: -500px;
background: #00f;
text-align: center;
}
</style>