forked from vincentzyc/form-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.vue
More file actions
69 lines (65 loc) · 1.49 KB
/
header.vue
File metadata and controls
69 lines (65 loc) · 1.49 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
<template>
<div class="flex header-wrap">
<div class="logo align-self-middle">动态表单设计</div>
<div class="flex flex-auto justify-end">
<el-dropdown trigger="click" class="flex dropdown align-middle" placement="bottom">
<span class="el-dropdown-link">
<strong>{{username}}</strong>
<i class="el-icon-caret-bottom drop-icon"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="changePass()">修改密码</el-dropdown-item>
<el-dropdown-item @click.native="loginout()">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</template>
<script>
export default {
data() {
return {
name: "Hello World"
};
},
computed: {
username() {
let userInfo = this.$util.getLStorage("loanuser", "decode");
return userInfo ? userInfo.username : this.name;
}
},
methods: {
changePass() { },
loginout() {
window.localStorage.removeItem("loanuser");
this.$router.replace("/login");
}
}
};
</script>
<style scoped>
.header-wrap {
/* height: 100%; */
position: relative;
width: 100%;
height: 70px;
font-size: 22px;
color: #fff;
box-sizing: border-box;
background-color: #242f42;
}
.logo {
padding: 0 30px;
text-align: center;
}
.dropdown {
height: 100%;
padding: 0 30px;
color: #eee;
user-select: none;
/* background: #eee; */
}
.el-dropdown-link {
cursor: pointer;
}
</style>