AppHeader.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div style="position: relative;height: 5rem;">
  3. <nav class="header-box" :class="{'visible':visible}">
  4. <router-link to="/home">
  5. <div class="header-item">
  6. <i class="icon-mall-gongnengguanli"></i>功能列表
  7. </div>
  8. </router-link>
  9. <router-link to="/noticeCenter">
  10. <div class="header-item">
  11. <el-badge :value="2" class="item">
  12. <i class="el-icon-message-solid"></i>
  13. </el-badge>
  14. 通知中心
  15. </div>
  16. </router-link>
  17. <router-link to="/pointsRank">
  18. <div class="header-item">
  19. <i class="el-icon-trophy"></i>积分排行
  20. </div>
  21. </router-link>
  22. </nav>
  23. </div>
  24. </template>
  25. <script lang="ts">
  26. export default {
  27. props:['visible'],
  28. }
  29. </script>
  30. <style>
  31. .header-box {
  32. display: flex;
  33. justify-content: center;
  34. align-items: center;
  35. position: fixed;
  36. top: 0;
  37. left: 0;
  38. right: 0;
  39. background: #fff;
  40. border-bottom: 1px solid #f1f1f1;
  41. color: #909090;
  42. height: 5rem;
  43. z-index: 250;
  44. transition: all .2s;
  45. transform: translate3d(0,-100%,0);
  46. }
  47. .header-item {
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. flex-direction: column;
  52. padding: 0 80px;
  53. }
  54. nav a {
  55. font-weight: bold;
  56. color: #515767;
  57. }
  58. nav a.route-active {
  59. color: #1e80ff;
  60. }
  61. .header-item i {
  62. font-size: 30px;
  63. margin-bottom: 5px;
  64. }
  65. .header-box.visible{
  66. transform: translateZ(0);
  67. }
  68. </style>