leftBar.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div class="bottom">
  3. <el-row class="tac">
  4. <el-col :span="12">
  5. <el-menu :default-active="path" background-color="#fff" text-color="#777" active-text-color="#fff" router>
  6. </el-menu>
  7. </el-col>
  8. </el-row>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. props: {
  14. luyou: Number,
  15. nav: Array
  16. },
  17. data() {
  18. return {
  19. path: this.$route.path,
  20. };
  21. },
  22. methods: {
  23. clickItem: function (path) {
  24. this.$router.push(path);
  25. },
  26. },
  27. watch: {
  28. luyou: {
  29. handler(n, o) {
  30. this.path = this.$route.path;
  31. },
  32. deep: true, // 深度监听父组件传过来对象变化
  33. },
  34. },
  35. };
  36. </script>
  37. <style scoped>
  38. .bottom {
  39. position: absolute;
  40. left: 20px;
  41. margin-top: 20px;
  42. background-color: #fff;
  43. width: 180px;
  44. height: calc(100% - 100px);
  45. min-height: 500px;
  46. z-index: 999;
  47. display: inline-block;
  48. border-radius: 5px;
  49. overflow: hidden;
  50. }
  51. .item {
  52. margin: 5px 20%;
  53. float: left;
  54. }
  55. .item p {
  56. margin: 0;
  57. font-size: 15px;
  58. }
  59. .active {
  60. color: #108b70;
  61. }
  62. .bottom>>>.el-menu-item.is-active {
  63. background: #3d67bc !important;
  64. }
  65. .tac>>>.el-col-12 {
  66. width: 100%;
  67. }
  68. .tac>>>.el-menu {
  69. border-right: none;
  70. }
  71. .tac>>>.el-menu-item {
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. }
  76. </style>