1.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="listNewsTitle">
  3. 本网招聘
  4. </div>
  5. <ul class="list" v-if="componentStyle==1">
  6. <div v-if="newsList.length>0">
  7. <li v-for="(item, index) in newsList" :key="index">
  8. <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
  9. {{getTitleLength(item.con_title,50)}}
  10. <span>{{ getTime(item.updated_at,'month',1) }}</span>
  11. </NuxtLink>
  12. </li>
  13. </div>
  14. <div v-else-if="newsList.con_title">
  15. <li>
  16. <NuxtLink :to="{ path: `zhaopin/${newsList.id}.html` }" :title="newsList.con_title">
  17. {{newsList.con_title}}
  18. <span>{{ getTime(newsList.updated_at,'month',1) }}</span>
  19. </NuxtLink>
  20. </li>
  21. </div>
  22. </ul>
  23. <ul class="list listStyle2" v-if="componentStyle==2">
  24. <div v-if="newsList.length>0">
  25. <li v-for="(item, index) in newsList" :key="index">
  26. <NuxtLink :to="{ path: `zhaopin/${item.id}.html` }" :title="item.con_title">
  27. {{getTitleLength(item.con_title,50)}}
  28. <span>{{ getTime(item.updated_at,'month',1) }}</span>
  29. </NuxtLink>
  30. </li>
  31. </div>
  32. <div v-else-if="newsList.con_title">
  33. <li>
  34. <NuxtLink :to="{ path: `zhaopin/${newsList.id}.html` }" :title="newsList.con_title">
  35. {{newsList.con_title}}
  36. <span>{{ getTime(newsList.updated_at,'month',1) }}</span>
  37. </NuxtLink>
  38. </li>
  39. </div>
  40. </ul>
  41. </template>
  42. <script setup>
  43. const props = defineProps({
  44. newsList: Array,//模板数据
  45. componentStyle: Number//样式编号
  46. });
  47. </script>
  48. <style lang="less" scoped>
  49. //基本样式 start ---------------------------------------->
  50. .listNewsTitle {
  51. font-size: 22px;
  52. font-weight: bold;
  53. height: 44px;
  54. border-bottom: 2px solid #004564;
  55. color: #004564;
  56. box-sizing: border-box;
  57. margin-top: 28px;
  58. margin-bottom: 30px;
  59. }
  60. //基本样式 end ---------------------------------------->
  61. //样式1 start ---------------------------------------->
  62. .list {
  63. margin-bottom: 30px;
  64. padding-bottom: 10px;
  65. margin-top: 10px;
  66. li {
  67. width: 100%;
  68. height: 60px;
  69. white-space: nowrap;
  70. overflow: hidden;
  71. text-overflow: ellipsis;
  72. line-height: 60px;
  73. &:nth-child(1),&:nth-child(6),&:nth-child(11),&:nth-child(16) {
  74. font-size: 18px;
  75. font-weight: bold;
  76. }
  77. &:nth-child(5),&:nth-child(10),&:nth-child(15),&:nth-child(20) {
  78. border-bottom: 1px solid #D9D9D9;
  79. margin-bottom: 30px;
  80. }
  81. &:nth-child(20){
  82. margin-bottom: 0;
  83. }
  84. a {
  85. width: 100%;
  86. display: block;
  87. height: 26px;
  88. cursor: pointer;
  89. font-family: Microsoft YaHei, Microsoft YaHei;
  90. font-size: 18px;
  91. color: #333333;
  92. line-height: 26px;
  93. text-align: left;
  94. font-style: normal;
  95. text-transform: none;
  96. span {
  97. float: right;
  98. display: inline-block;
  99. width: 60px;
  100. height: 24px;
  101. line-height: 24px;
  102. }
  103. }
  104. }
  105. }
  106. //样式1 end ---------------------------------------->
  107. //样式2 start ---------------------------------------->
  108. .listStyle2 {
  109. li {
  110. &:nth-child(1),&:nth-child(6),&:nth-child(11),&:nth-child(16) {
  111. font-size: 18px;
  112. font-weight: normal;
  113. }
  114. }
  115. }
  116. //样式2 end ---------------------------------------->
  117. </style>