App.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div id="app" @mousemove="mousemove">
  3. <nav id="nav" :style="{ height: navHeight + 'px' }">
  4. <router-link to="/" class="a">首页</router-link>
  5. <router-link to="/monitor" class="a">视频监控</router-link>
  6. <router-link to="/biology" class="a">生物防控</router-link>
  7. <router-link to="/robot" class="a">机器人巡查</router-link>
  8. <router-link to="/environmentalProtection" class="a">环保监测</router-link>
  9. <!-- <router-link to="/userAdmin" class="a">人员管理</router-link>-->
  10. </nav>
  11. <header class="header">华腾石湾乡村振兴智能化管理平台</header>
  12. <router-view />
  13. </div>
  14. </template>
  15. <script>
  16. export default {
  17. name: "app",
  18. data() {
  19. return {
  20. navHeight: 0,
  21. };
  22. },
  23. mounted() {
  24. // this.init();
  25. },
  26. methods: {
  27. init() {
  28. this.$http.post('http://122.112.252.100:8088/publicNetwork/add')
  29. .then(res => {
  30. console.log(res);
  31. })
  32. },
  33. mousemove(e) {
  34. if (e.y <= 80) {
  35. this.navHeight = 70;
  36. } else {
  37. this.navHeight = 0;
  38. }
  39. },
  40. },
  41. };
  42. </script>
  43. <style lang="scss">
  44. #app {
  45. height: 100%;
  46. min-width: 1600px;
  47. max-width: 2000px;
  48. // min-height: 800px;
  49. max-height: 1200px;
  50. background-color: #060A2D;
  51. display: flex;
  52. flex-direction: column;
  53. #nav {
  54. width: 100%;
  55. position: fixed;
  56. background-color: #0e1e51;
  57. color: #eee;
  58. transition: height 0.4s;
  59. overflow: hidden;
  60. line-height: 80px;
  61. padding-left: 30px;
  62. z-index: 99;
  63. .a {
  64. color: #eee;
  65. margin: 0 20px;
  66. padding: 12px;
  67. background-color: #142b77;
  68. border-radius: 6px;
  69. }
  70. }
  71. > .header {
  72. // border: 1px solid #8877dd;
  73. background: url(./assets/bg_header.png) no-repeat;
  74. background-size: 100% 100%;
  75. width: 100%;
  76. height: 20%;
  77. line-height: 50px;
  78. // font-size: 1.3vw;
  79. font-size: 22px;
  80. font-weight: 600;
  81. color: #fff;
  82. text-align: center;
  83. }
  84. }
  85. </style>