menuInfo.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div id="menuInfo">
  3. <el-row>
  4. <el-col :span="24" class="menu">
  5. <el-menu
  6. :default-active="thisRouter()"
  7. class="el-menu-demo"
  8. mode="horizontal"
  9. :router="false"
  10. :default-openeds="defalutMenu"
  11. @select="to"
  12. text-color="#fff"
  13. >
  14. <el-menu-item index="/">网站首页</el-menu-item>
  15. <el-menu-item index="/government/government">科技政务</el-menu-item>
  16. <el-menu-item index="/policy/policy">科技政策</el-menu-item>
  17. <el-menu-item index="/supermaket/supermarket">科技超市</el-menu-item>
  18. <el-menu-item index="/shuju/shuju">科技数据</el-menu-item>
  19. <el-menu-item index="/service/service">科技服务</el-menu-item>
  20. <el-menu-item index="/">
  21. <el-link
  22. style="padding: 0px 0px;font-size: 22px;"
  23. :underline="false"
  24. href="http://139.210.167.203/free-technological-management/mapApply/getMap"
  25. target="_blank"
  26. >科技资源</el-link
  27. >
  28. </el-menu-item>
  29. <el-menu-item index="/personnel/personnel">科技人才</el-menu-item>
  30. </el-menu>
  31. </el-col>
  32. </el-row>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'menuInfo',
  38. props: {},
  39. components: {},
  40. data: () => ({
  41. defalutMenu: [],
  42. }),
  43. created() {},
  44. computed: {},
  45. methods: {
  46. thisRouter() {
  47. console.log(this.$route.path);
  48. },
  49. to(index) {
  50. this.$router.push({ path: index });
  51. },
  52. },
  53. };
  54. </script>
  55. <style lang="less" scoped>
  56. .menu {
  57. height: 70px;
  58. overflow: hidden;
  59. background-color: rgba(0, 0, 0, 0.4);
  60. }
  61. /deep/.el-menu {
  62. background-color: rgba(0, 0, 0, 0.4);
  63. }
  64. /deep/.el-menu--horizontal > .el-menu-item {
  65. height: 70px;
  66. line-height: 70px;
  67. border-right: 1px solid #ccc;
  68. padding: 0 30px;
  69. font-size: 22px;
  70. }
  71. /deep/.el-menu--horizontal > .el-menu-item:last-child {
  72. padding: 0 34px 0 33px;
  73. }
  74. /deep/.el-menu--horizontal > .el-menu-item.is-active {
  75. border-bottom: none;
  76. color: #fff;
  77. background-color: #215299;
  78. }
  79. /deep/.el-menu--horizontal > .el-menu-item:hover {
  80. background-color: #215299;
  81. }
  82. </style>