2.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div class="listNewsTitle_skin2" >
  3. <span>本网招聘</span>
  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_skin2 {
  51. font-size: 22px;
  52. font-weight: bold;
  53. height: 44px;
  54. border-bottom: 2px solid #A91B33;
  55. color: #A91B33;
  56. box-sizing: border-box;
  57. margin-top: 28px;
  58. margin-bottom: 30px;
  59. span {
  60. border-left: 3px solid #A91B33;
  61. padding-left: 12px;
  62. display: inline-block;
  63. height: 25px;
  64. line-height: 25px;
  65. }
  66. }
  67. //基本样式 end ---------------------------------------->
  68. //样式1 start ---------------------------------------->
  69. .list {
  70. margin-bottom: 30px;
  71. padding-bottom: 10px;
  72. margin-top: 10px;
  73. li {
  74. width: 100%;
  75. height: 60px;
  76. white-space: nowrap;
  77. overflow: hidden;
  78. text-overflow: ellipsis;
  79. line-height: 60px;
  80. &:nth-child(1),&:nth-child(6),&:nth-child(11),&:nth-child(16) {
  81. font-size: 18px;
  82. font-weight: bold;
  83. }
  84. &:nth-child(5),&:nth-child(10),&:nth-child(15),&:nth-child(20) {
  85. border-bottom: 1px solid #D9D9D9;
  86. margin-bottom: 30px;
  87. }
  88. &:nth-child(20){
  89. margin-bottom: 0;
  90. }
  91. a {
  92. width: 100%;
  93. display: block;
  94. height: 26px;
  95. cursor: pointer;
  96. font-family: Microsoft YaHei, Microsoft YaHei;
  97. font-size: 18px;
  98. color: #333333;
  99. line-height: 26px;
  100. text-align: left;
  101. font-style: normal;
  102. text-transform: none;
  103. span {
  104. float: right;
  105. display: inline-block;
  106. width: 60px;
  107. height: 24px;
  108. line-height: 24px;
  109. }
  110. }
  111. }
  112. }
  113. //样式1 start ---------------------------------------->
  114. //样式2 start ---------------------------------------->
  115. .listStyle2 {
  116. li {
  117. &:nth-child(1),&:nth-child(6),&:nth-child(11),&:nth-child(16) {
  118. font-size: 18px;
  119. font-weight: normal;
  120. }
  121. }
  122. }
  123. //样式2 end ---------------------------------------->
  124. </style>