gainRight.vue 3.7 KB

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