tabLeft4.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="left">
  3. <ul>
  4. <li :class="{active:ind===item.id}" v-for="(item, index) in tabList" :key="index" @click="skip(item.id)">
  5. <i class="el-icon-edit"></i>
  6. {{ item.name }}
  7. </li>
  8. </ul>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. components: {},
  14. props: {
  15. ind: {
  16. type: Number,
  17. default: 0
  18. }
  19. },
  20. data () {
  21. return {
  22. tabList: [
  23. { name: '用户管理', id: 2 },
  24. { name: '系统日志', id: 1 }
  25. ]
  26. }
  27. },
  28. methods: {
  29. skip (index) {
  30. this.$router.push(`/layout/system${index}`).catch(() => {})
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang='less' scoped>
  36. .left {
  37. width: 220px;
  38. min-width: 130px;
  39. height: 868px;
  40. background-color: #fff;
  41. box-shadow: 1px 1px 10px 1px;
  42. ul {
  43. li {
  44. cursor: pointer;
  45. color: black;
  46. font-size: 16px;
  47. height: 60px;
  48. display: flex;
  49. align-items: center;
  50. i {
  51. margin: 0 18px;
  52. }
  53. }
  54. li:hover{
  55. background:#e6f7ff ;
  56. }
  57. .active {
  58. background:#e6f7ff ;
  59. }
  60. }
  61. }</style>