fenlei.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div id="fenlei">
  3. <el-col class="swfl">
  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" @click="clickUrl(item.id)"
  10. ><span slot="title">{{ item.name }}</span></el-menu-item
  11. >
  12. </el-menu>
  13. </el-col>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'fenlei',
  19. props: {
  20. liebiaoList: null,
  21. },
  22. components: {},
  23. data: () => ({
  24. src: require('@/assets/swfl.png'),
  25. }),
  26. created() {},
  27. computed: {},
  28. methods: {
  29. clickUrl(id) {
  30. this.$router.push({ path: '/shuju/shujulist' });
  31. // this.$emit('clickLists', { id });
  32. },
  33. handleOpen(key, keyPath) {
  34. console.log(key, keyPath);
  35. },
  36. handleClose(key, keyPath) {
  37. console.log(key, keyPath);
  38. },
  39. },
  40. };
  41. </script>
  42. <style lang="less" scoped>
  43. .swfl {
  44. height: 60px;
  45. width: 240px;
  46. line-height: 60px;
  47. background-color: #22529a;
  48. text-align: center;
  49. }
  50. .swfl span {
  51. font-size: 22px;
  52. color: #ffffff;
  53. }
  54. /deep/.el-menu-item {
  55. height: 60px;
  56. text-align: center;
  57. line-height: 60px;
  58. border-bottom: 1px dashed;
  59. font-size: 22px;
  60. }
  61. /deep/.el-menu-item:last-child {
  62. border-bottom: none;
  63. }
  64. </style>