navbar.vue.bak 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="banner">
  3. <el-menu class="nav-menu" mode="horizontal" background-color="transparent" text-color="#fff" active-text-color="#ffd04b">
  4. <naf-menu-item
  5. v-for="(item, idx) in menuItems"
  6. :key="idx"
  7. :index="idx.toString()"
  8. :title="item.title"
  9. :options="item.options"
  10. :children="item.children"
  11. :target="item.target"
  12. :prefix="routerPrefix"
  13. >
  14. </naf-menu-item>
  15. </el-menu>
  16. <naf-user />
  17. </div>
  18. </template>
  19. <script>
  20. import NafMenuItem from '../menu-item';
  21. import NafUser from './user';
  22. export default {
  23. components: {
  24. NafMenuItem,
  25. NafUser,
  26. },
  27. props: {
  28. menuItems: Array,
  29. routerPrefix: { type: String, default: '' },
  30. },
  31. };
  32. </script>
  33. <style lang="less" scoped>
  34. .banner {
  35. // flex: 1;
  36. // display: flex;
  37. // flex-direction: row;
  38. padding: 0 20px;
  39. width: 58%;
  40. clear: both;
  41. }
  42. .nav-menu {
  43. // flex: 1;
  44. float: left;
  45. border-bottom: 0;
  46. background: none;
  47. height: 70%;
  48. top: 0;
  49. }
  50. .el-menu-item {
  51. height: 100%;
  52. line-height: 6.8rem;
  53. font-size: 1rem;
  54. font-weight: 600;
  55. }
  56. .el-menu-item:hover {
  57. background: #21c3f2 !important;
  58. }
  59. </style>