rightcont.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <div id="rightcont">
  3. <el-col class="zhengce">
  4. <el-col :span="24" class="topTitle">
  5. {{ columnName }}
  6. </el-col>
  7. <el-col :span="24" class="info">
  8. <ul>
  9. <li v-for="(item, index) in contentList" :key="index" @click="$emit('fetch', item.id)">
  10. <el-col :span="21" class="title textOver">{{ item.title }}</el-col>
  11. <el-col :span="3" class="date">
  12. {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
  13. </el-col>
  14. </li>
  15. </ul>
  16. <el-col class="page" :span="24">
  17. <el-pagination
  18. @size-change="handleSizeChange"
  19. @current-change="handleCurrentChange"
  20. :current-page="currentPage"
  21. layout="total, prev, pager, next, jumper"
  22. :total="total"
  23. >
  24. </el-pagination>
  25. </el-col>
  26. </el-col>
  27. </el-col>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'rightcont',
  33. props: {
  34. columnName: null,
  35. contentList: null,
  36. total: null,
  37. },
  38. components: {},
  39. data: () => ({
  40. currentPage: 1,
  41. }),
  42. created() {},
  43. computed: {},
  44. methods: {
  45. handleSizeChange(val) {
  46. console.log(`每页 ${val} 条`);
  47. },
  48. handleCurrentChange(val) {
  49. console.log(`当前页: ${val}`);
  50. },
  51. },
  52. };
  53. </script>
  54. <style lang="less" scoped>
  55. ul {
  56. margin: 0;
  57. }
  58. li {
  59. padding: 0;
  60. margin: 0;
  61. color: #a8abb7;
  62. }
  63. .zhengce {
  64. height: 660px;
  65. padding: 20px;
  66. overflow: hidden;
  67. }
  68. .topTitle {
  69. font-size: 22px;
  70. color: #22529a;
  71. margin: 0 0 20px 0;
  72. }
  73. .info {
  74. height: 570px;
  75. overflow: hidden;
  76. }
  77. .info ul {
  78. height: 510px;
  79. overflow: hidden;
  80. padding: 0 0 0 20px;
  81. }
  82. .info ul li {
  83. float: left;
  84. width: 100%;
  85. padding: 0 0 13px 0;
  86. }
  87. .info ul li .title {
  88. font-size: 16px;
  89. color: #60636d;
  90. }
  91. .info ul li .date {
  92. font-size: 16px;
  93. color: #a8abb7;
  94. text-align: right;
  95. }
  96. .info ul li:hover {
  97. cursor: pointer;
  98. }
  99. .info ul li:hover .title {
  100. color: #22529a;
  101. }
  102. .info ul li:hover .date {
  103. color: #22529a;
  104. }
  105. .page {
  106. padding: 11px 0;
  107. text-align: center;
  108. }
  109. </style>