newsRight.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 newsRightList" :key="index"
  21. :type="item.type">
  22. <el-col :span="24" class="twoTitle">
  23. <el-col :span="21" class="title">
  24. <p class="textOver">{{ item.title }}</p>
  25. </el-col>
  26. <el-col :span="3" class="more">
  27. <!-- @click="$router.push({ path: `moreList/${newsRightList[0].id}` })" -->
  28. <el-link :underline="false" @click="$router.push({ path: '/lists/moreList' })">more</el-link>
  29. </el-col>
  30. </el-col>
  31. <el-col :span="24" class="children" v-for="(tag, index) in item.children" :key="index">
  32. <el-col :span="20" class="title" @click.native="$router.push({ name: 'detail', params:{id:tag.id} })">
  33. <p class="textOver">{{ tag.title }}</p>
  34. </el-col>
  35. <el-col :span="4" class="time">
  36. {{tag.publish_time}}
  37. </el-col>
  38. </el-col>
  39. </el-col>
  40. </el-col>
  41. </el-col>
  42. </el-row>
  43. </div>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'newsRight',
  48. props: {
  49. newsRightList: null,
  50. },
  51. components: {},
  52. data: () => ({
  53. input3: '',
  54. currentPage: 1,
  55. }),
  56. created() { },
  57. computed: {},
  58. methods: {
  59. handleSizeChange(val) {
  60. // eslint-disable-next-line no-console
  61. console.log(`每页 ${val} 条`);
  62. },
  63. handleCurrentChange(val) {
  64. // eslint-disable-next-line no-console
  65. console.log(`当前页: ${val}`);
  66. }
  67. },
  68. };
  69. </script>
  70. <style lang="less" scoped>
  71. p {
  72. margin: 0;
  73. padding: 0;
  74. }
  75. .textOver {
  76. overflow: hidden;
  77. text-overflow: ellipsis;
  78. white-space: nowrap;
  79. }
  80. .main {
  81. width: 880px;
  82. min-height: 500px;
  83. margin: 0 0 0 20px;
  84. background-color: rgba(255, 255, 255, 0.8);
  85. }
  86. .top {
  87. margin: 10px 0 0 20px;
  88. }
  89. .search {
  90. margin: 20px 0;
  91. padding: 0 20px;
  92. }
  93. /deep/.el-input-group {
  94. width: 40%;
  95. }
  96. /deep/.el-input__inner {
  97. border: 1px solid #336699;
  98. }
  99. /deep/.el-input-group__append {
  100. border: 1px solid #336699;
  101. background-color: #336699;
  102. color: #fff;
  103. }
  104. .list {
  105. padding: 0 20px;
  106. }
  107. .twoTitle {
  108. padding: 10px 0;
  109. }
  110. .twoTitle .title {
  111. font-size: 25px;
  112. font-weight: bold;
  113. }
  114. .twoTitle .more .el-link {
  115. font-size: 18px;
  116. color: #336699;
  117. text-transform: uppercase;
  118. }
  119. .children {
  120. padding: 8px 10px;
  121. border-bottom: 1px dashed #000;
  122. }
  123. .children:hover .title {
  124. color: #336699;
  125. cursor: pointer;
  126. }
  127. .children .title {
  128. font-size: 18px;
  129. }
  130. .children .time {
  131. font-size: 18px;
  132. text-align: center;
  133. color: red;
  134. }
  135. </style>