| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <template>
- <div class="header">
- 后台管理系统
- <div class="user-info">
- <el-dropdown trigger="click" @command="handleCommand">
- <span class="el-dropdown-link">
- <img class="user-logo" src="../../../static/img/img.jpg">
- linxin
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="loginout">退出</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- sName: 'abcd'
- }
- },
- methods:{
- handleCommand(command) {
- if(command == 'loginout'){
- console.log(1)
- this.$router.push('/login');
- }
- },
- loginOut(){
- }
- }
- }
- </script>
- <style scoped>
- .header {
- position: relative;
- box-sizing: border-box;
- padding-left: 50px;
- width: 100%;
- height: 70px;
- font-size: 22px;
- line-height: 70px;
- color: #fff;
- background-color: #242f42;
- }
- .user-info {
- float: right;
- padding-right: 50px;
- font-size: 16px;
- color: #fff;
- }
- .user-info .el-dropdown-link{
- position: relative;
- display: inline-block;
- padding-left: 50px;
- color: #fff;
- cursor: pointer;
- vertical-align: middle;
- }
- .user-info .user-logo{
- position: absolute;
- left:0;
- top:15px;
- width:40px;
- height:40px;
- border-radius: 50%;
- }
- .el-dropdown-menu__item{
- text-align: center;
- }
- </style>
|