index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <el-card class="train-container" header="安全培训">
  3. <el-collapse accordion>
  4. <el-collapse-item class="tag-list">
  5. <template slot="title">
  6. <div class="tag-header">
  7. <span class="lable">类别一:</span>
  8. <el-tag @click="changeTag(-1)">全部</el-tag>
  9. <el-tag v-for="tag in 10" :key="tag" type="info" @click="changeTag(tag)">标签标题-{{ tag }}</el-tag>
  10. </div>
  11. </template>
  12. <div class="tag-cont">
  13. <el-tag v-for="tagcont in 10" :key="tagcont" type="info">标签内容-{{ tagcont }}</el-tag>
  14. </div>
  15. </el-collapse-item>
  16. </el-collapse>
  17. <el-row class="train-list" :gutter="15" justify>
  18. <el-col v-for="(item, index) in 10" :key="index" :span="4">
  19. <el-card :body-style="{ padding: '0px' }" style="margin-bottom: 10px;" @click="showDetail(item)">
  20. <div @click="showDetail(item)">
  21. <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
  22. <div style="padding: 14px;">
  23. <span>好吃的汉堡</span>
  24. <div class="bottom clearfix">
  25. <time class="time">{{ new Date() }}</time>
  26. <el-button type="text" class="button">操作按钮</el-button>
  27. </div>
  28. </div>
  29. </div>
  30. </el-card>
  31. </el-col>
  32. </el-row>
  33. </el-card>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'TrainComponent',
  38. components: {},
  39. data() {
  40. return {}
  41. },
  42. methods: {
  43. changeTag(tag) {
  44. },
  45. showDetail(item) {
  46. this.$router.push({
  47. path: '/test/detail',
  48. query: {
  49. id: item
  50. }
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .train-container{
  58. .tag-list{
  59. .lable{
  60. display: inline-block;
  61. width: 80px;
  62. line-height: 1;
  63. font-size: 12px;
  64. padding-left:10px ;
  65. box-sizing: border-box;
  66. }
  67. .tag-header{
  68. display: flex;
  69. align-items: center;
  70. flex-wrap: wrap;
  71. }
  72. .tag-cont{
  73. padding-left: 80px;
  74. display: flex;
  75. align-items: center;
  76. flex-wrap: wrap;
  77. }
  78. .el-tag{
  79. margin-right: 10px;
  80. }
  81. }
  82. .train-list{
  83. padding-top: 10px;
  84. .image {
  85. width: 100%;
  86. display: block;
  87. }
  88. }
  89. }
  90. </style>