HeadBar.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-backtop></el-backtop>
  5. <el-main style="padding: 0">
  6. <el-row>
  7. <el-col :span="10" :offset="4">
  8. <nuxt-link to="/">
  9. <img style="max-height: 70px" src="/img/lt_logo.png" alt="">
  10. </nuxt-link>
  11. </el-col>
  12. <el-col :span="8">
  13. <el-row>
  14. <el-col :span="5">
  15. <div style="line-height: 70px;text-align: center;font-size: 1.3rem">
  16. <span>登录</span>
  17. <span>注册</span>
  18. </div>
  19. </el-col>
  20. <el-col :span="10">
  21. <div style="line-height: 70px;text-align: center;margin-right:10px">
  22. <el-input v-model="searchValue" class="inline-input" placeholder="请输入内容" >
  23. <el-button @click="to_search()" slot="append" icon="el-icon-search"></el-button>
  24. </el-input>
  25. </div>
  26. </el-col>
  27. <el-col :span="3">
  28. <div style="margin: 10px">
  29. <div class="demo-basic--circle">
  30. <div class="block"><el-avatar :size="50" src="//cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"></el-avatar></div>
  31. <div class="block" v-for="size in sizeList" :key="size">
  32. <el-avatar :size="size" :src="circleUrl"></el-avatar>
  33. </div>
  34. </div>
  35. </div>
  36. </el-col>
  37. </el-row>
  38. </el-col>
  39. </el-row>
  40. </el-main>
  41. <el-footer style="background-color: #4D4D4D;">
  42. <el-row>
  43. <el-col :span="18" offset="3">
  44. <el-menu
  45. class="el-menu-demo"
  46. mode="horizontal"
  47. router
  48. background-color="#4D4D4D"
  49. text-color="#fff"
  50. >
  51. <template v-for="(item,i) in nav_list">
  52. <el-submenu v-if="item.navInfos.length !=0" :index="item.navUrl" :key="item.navId">
  53. <template slot="title">
  54. <!-- <n-link style="text-decoration: none;" :to="{name:'Association',params:{id: item.navId,title:item.navTitle}}">{{item.navTitle}}-->
  55. <!-- </n-link>-->
  56. {{ item.navTitle }}
  57. </template>
  58. <el-menu-item
  59. v-for="(items, key) in item.navInfos"
  60. :key="key"
  61. :index="items.navUrl"
  62. >
  63. {{ items.navTitle }}
  64. </el-menu-item>
  65. </el-submenu>
  66. <el-menu-item v-else :index="item.navUrl" :key="item.navId">
  67. {{ item.navTitle }}
  68. </el-menu-item>
  69. </template>
  70. </el-menu>
  71. </el-col>
  72. </el-row>
  73. </el-footer>
  74. </el-container>
  75. </div>
  76. </template>
  77. <script>
  78. import {navList} from "../static/js/index"
  79. export default {
  80. name: "HeadBar",
  81. data(){
  82. return{
  83. nav_list:null,
  84. searchValue:null
  85. }
  86. },created() {
  87. this.nav_list=this.getNavList();
  88. },methods: {
  89. to_search(){
  90. this.$router.push(
  91. { name: 'searchInfo-id', params: { key: this.searchValue }}
  92. )
  93. },
  94. getNavList(){
  95. navList().then(response=>{
  96. this.nav_list=response.rows;
  97. })
  98. },
  99. }
  100. }
  101. </script>
  102. <style scoped>
  103. body{
  104. margin: 0;
  105. }
  106. html,body{
  107. padding: 0;
  108. margin: 0;
  109. }
  110. </style>
  111. <style>
  112. a{
  113. text-decoration:none;
  114. color: black;
  115. }
  116. a:visited{text-decoration:none;}
  117. </style>