index.vue 1.89 KB
<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>