news.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <div id="news">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-col :span="24" class="title">
  6. <span>{{title}}</span>
  7. </el-col>
  8. <el-col :span="24">
  9. <el-col :span="13" class="block">
  10. <el-carousel ref="shubiao">
  11. <el-carousel-item v-for="(item, index) in newsList" :key="index" :name="`${index}`">
  12. <el-link :underline="false">
  13. <el-image style="width:620px;height:350px;" :src="item.picurl" class="newsList"></el-image>
  14. </el-link>
  15. </el-carousel-item>
  16. </el-carousel>
  17. </el-col>
  18. <el-col :span="11" class="newsLi">
  19. <ul>
  20. <li class="listdata"><span class="qiudata"></span>
  21. <el-link :underline="false">今天(3月8日星期五)</el-link>
  22. </li>
  23. <li class="list" v-for="(tag, index) in newsList" :key="index" :type="tag.type" @mouseover="shuYi(index)"
  24. :class="newListActive(tag)">
  25. <span class="qiu"></span>
  26. <el-link :underline="false" class="newsListTit">{{ tag.title }}</el-link>
  27. </li>
  28. </ul>
  29. </el-col>
  30. </el-col>
  31. </el-col>
  32. </el-row>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. name: 'news',
  38. props: {
  39. newsList: null,
  40. },
  41. components: {},
  42. data: () => ({
  43. title: '就业新闻',
  44. }),
  45. created() { },
  46. computed: {},
  47. methods: {
  48. shuYi(index) {
  49. this.$refs.shubiao.setActiveItem(`${index}`);
  50. },
  51. // eslint-disable-next-line no-unused-vars
  52. newListActive(item) { },
  53. },
  54. };
  55. </script>
  56. <style lang="less" scoped>
  57. ul {
  58. margin: 0;
  59. padding: 0;
  60. }
  61. li {
  62. list-style: none;
  63. }
  64. .title {
  65. color: #333;
  66. font-size: 24px;
  67. font-family: 微软雅黑;
  68. font-weight: bold;
  69. margin-bottom: 15px;
  70. }
  71. /deep/.el-carousel__indicators--horizontal {
  72. display: none;
  73. }
  74. /deep/.el-carousel__arrow {
  75. display: none;
  76. }
  77. /deep/.el-carousel__container {
  78. height: 350px;
  79. }
  80. .block{
  81. width:620px;
  82. height:350px;
  83. }
  84. .newsLi {
  85. width: 580px;
  86. height:350px;
  87. background-color: #eeeeee;
  88. overflow: hidden;
  89. }
  90. .list {
  91. height: 50px;
  92. line-height: 50px;
  93. border-left: 5px solid #eeeeee;
  94. }
  95. .listdata {
  96. height: 50px;
  97. line-height: 50px;
  98. border-left: 5px solid #eeeeee;
  99. }
  100. .listdata .el-link {
  101. color: #999999;
  102. font-size: 20px;
  103. font-family: 微软雅黑;
  104. }
  105. .list .el-link {
  106. color: #999999;
  107. font-size: 20px;
  108. font-family: 微软雅黑;
  109. }
  110. .list:hover {
  111. border-left: 5px solid #415285;
  112. background: #fff;
  113. }
  114. .list:hover .el-link {
  115. color: #333;
  116. }
  117. .list:hover .qiu{
  118. background: #415285;
  119. }
  120. .qiudata {
  121. display: inline-block;
  122. width: 10px;
  123. height: 10px;
  124. background: #fff;
  125. border:1px solid #ccc;
  126. border-radius: 90px;
  127. margin: 0 15px;
  128. }
  129. .qiu {
  130. display: inline-block;
  131. width: 10px;
  132. height: 10px;
  133. background: #d5d5d5;
  134. border-radius: 90px;
  135. margin: 0 15px;
  136. }
  137. </style>