index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div class="index">
  3. <div class="header">
  4. <img class="bg" :src="`${publicPath}img/nav-img.png`" alt="" />
  5. <div class="title">
  6. <p>
  7. {{ $website.name }}<br />
  8. <small>{{ $website.subName }}</small>
  9. </p>
  10. </div>
  11. <navs @change="handleChange"></navs>
  12. </div>
  13. <el-scrollbar class="main">
  14. <router-view />
  15. </el-scrollbar>
  16. </div>
  17. </template>
  18. <script>
  19. import navs from "./nav/index.vue";
  20. export default {
  21. name: "index",
  22. components: {
  23. navs,
  24. },
  25. data() {
  26. return {
  27. publicPath: import.meta.env.VITE_APP_BASE,
  28. };
  29. },
  30. methods: {
  31. handleChange(item) {
  32. this.$router.push({ path: item.path });
  33. },
  34. },
  35. };
  36. </script>
  37. <style lang="scss">
  38. .index {
  39. height: 100%;
  40. .header {
  41. position: relative;
  42. height: 220px;
  43. .bg {
  44. width: 100%;
  45. height: 100%;
  46. }
  47. .nav {
  48. margin: 0 20px;
  49. width: 100%;
  50. position: absolute;
  51. bottom: 10px;
  52. border: none;
  53. .el-menu-item {
  54. background-color: rgba(0, 0, 0, 0) !important;
  55. }
  56. }
  57. .title {
  58. position: absolute;
  59. top: 60px;
  60. left: 20px;
  61. font-size: 48px;
  62. font-style: oblique;
  63. color: rgb(0, 186, 255);
  64. font-weight: bold;
  65. line-height: 35px;
  66. }
  67. .title small {
  68. font-size: 18px;
  69. color: #9cb4c2;
  70. }
  71. }
  72. .main {
  73. width: 100%;
  74. height: calc(100% - 220px);
  75. }
  76. }
  77. </style>