mainMenu.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div id="fenlei">
  3. <el-col class="swfl" :span="24">
  4. <el-image style="width:22px;height:22px;margin:0 5px -5px 0;" :src="src"></el-image>
  5. <span>个人中心</span>
  6. </el-col>
  7. <el-col>
  8. <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" text-color="#215299" active-text-color="#215299">
  9. <el-menu-item index="1" v-for="(item, index) in liebiaoList" :key="index">
  10. <template v-if="item.name.includes('消息')">
  11. <span slot="title" @click="clickUrl(item.name)" :style="`color:${haveMsg ? 'red' : ''}`">
  12. {{ item.name }}
  13. </span>
  14. </template>
  15. <template v-else>
  16. <span slot="title" @click="clickUrl(item.name)">{{ item.name }}</span>
  17. </template>
  18. </el-menu-item>
  19. </el-menu>
  20. </el-col>
  21. </div>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'fenlei',
  26. props: {
  27. liebiaoList: null,
  28. },
  29. components: {},
  30. data: () => ({
  31. src: require('@/assets/swfl.png'),
  32. haveMsg: false,
  33. }),
  34. created() {},
  35. computed: {},
  36. methods: {
  37. clickUrl(id) {
  38. this.$emit('onsave', { id });
  39. },
  40. handleOpen(key, keyPath) {
  41. console.log(key, keyPath);
  42. },
  43. handleClose(key, keyPath) {
  44. console.log(key, keyPath);
  45. },
  46. },
  47. };
  48. </script>
  49. <style lang="less" scoped>
  50. .swfl {
  51. height: 60px;
  52. line-height: 60px;
  53. background-color: #22529a;
  54. text-align: center;
  55. }
  56. .swfl span {
  57. font-size: 22px;
  58. color: #ffffff;
  59. }
  60. /deep/.el-menu-item {
  61. height: 60px;
  62. text-align: center;
  63. line-height: 60px;
  64. border-bottom: 1px dashed;
  65. font-size: 22px;
  66. }
  67. /deep/.el-menu-item:last-child {
  68. border-bottom: none;
  69. }
  70. </style>