moreList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <div id="newsRight">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="list">
  6. <el-col :span="24" class="mainRightList" v-for="(item, index) in newsList" :key="index" :type="item.type">
  7. <el-col :span="8" class="image">
  8. <el-image style="width:340px;height:250px;" :src="item.pic"></el-image>
  9. </el-col>
  10. <el-col :span="16">
  11. <el-col :span="24" class="title" @click.native="$router.push({ name: 'detail', params:{id:item.id} })">
  12. <p class="textOver">{{item.title}}</p>
  13. </el-col>
  14. <el-col :span="24" class="time">
  15. <p>{{item.publish_time}}</p>
  16. </el-col>
  17. <el-col :span="24" class="content">
  18. <p v-html="item.content"></p>
  19. </el-col>
  20. <el-col :span="24" class="button">
  21. <el-button type="primary" @click.native="$router.push({ name: 'detail', params:{id:item.id} })">进入
  22. </el-button>
  23. </el-col>
  24. </el-col>
  25. </el-col>
  26. </el-col>
  27. <el-col :span="24" class="page">
  28. <div class="block">
  29. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  30. :current-page="currentPage" layout="total,prev, pager, next, jumper" :total="total">
  31. </el-pagination>
  32. </div>
  33. </el-col>
  34. </el-col>
  35. </el-row>
  36. </div>
  37. </template>
  38. <script>
  39. export default {
  40. name: 'newsRight',
  41. props: {
  42. newsList: null,
  43. total: null,
  44. },
  45. components: {},
  46. data: () => ({
  47. input3: '',
  48. currentPage: 1,
  49. }),
  50. created() { },
  51. computed: {},
  52. methods: {
  53. handleSizeChange(val) {
  54. // eslint-disable-next-line no-console
  55. console.log(`每页 ${val} 条`);
  56. },
  57. handleCurrentChange(val) {
  58. // eslint-disable-next-line no-console
  59. console.log(`当前页: ${val}`);
  60. }
  61. },
  62. };
  63. </script>
  64. <style lang="less" scoped>
  65. p {
  66. margin: 0;
  67. padding: 0;
  68. }
  69. .textOver {
  70. overflow: hidden;
  71. text-overflow: ellipsis;
  72. white-space: nowrap;
  73. }
  74. .main {
  75. min-height: 500px;
  76. margin: 20px 0;
  77. background-color: rgba(255, 255, 255, 0.8);
  78. }
  79. .top {
  80. margin: 10px 0 0 20px;
  81. }
  82. .search {
  83. margin: 20px 0;
  84. padding: 0 20px;
  85. }
  86. /deep/.el-input-group {
  87. width: 40%;
  88. }
  89. /deep/.el-input__inner {
  90. border: 1px solid #336699;
  91. }
  92. /deep/.el-input-group__append {
  93. border: 1px solid #336699;
  94. background-color: #336699;
  95. color: #fff;
  96. }
  97. .list {
  98. padding: 0 20px;
  99. }
  100. .mainRightList {
  101. padding: 20px;
  102. margin: 0 0 20px 0;
  103. border: 1px dashed #000;
  104. }
  105. .mainRightList:hover .title {
  106. cursor: pointer;
  107. color: #336699;
  108. }
  109. .mainRightList .title {
  110. font-size: 30px;
  111. padding: 0 0 5px 0;
  112. }
  113. .mainRightList .time {
  114. font-size: 20px;
  115. color: #999;
  116. padding: 0 0 5px 0;
  117. }
  118. /deep/.mainRightList .content p p {
  119. text-indent: 2rem;
  120. font-size: 18px;
  121. line-height: 25px;
  122. overflow: hidden;
  123. text-overflow: ellipsis;
  124. -webkit-line-clamp: 5;
  125. word-break: break-all;
  126. display: -webkit-box;
  127. -webkit-box-orient: vertical;
  128. }
  129. .mainRightList .button {
  130. text-align: right;
  131. padding: 8px 25px;
  132. }
  133. /deep/.el-button {
  134. padding: 10px;
  135. }
  136. .page {
  137. padding: 0 20px;
  138. text-align: center;
  139. margin: 0 0 20px 0;
  140. }
  141. </style>