1.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div>
  3. <div v-if="componentStyle == 1">
  4. <div class="list_left_li_1" v-for="item in listData.slice(0, 10)">
  5. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
  6. :target="item.islink == 1 ? '_blank' : '_self'">
  7. <div class="list_left_li_head">
  8. <div class="list_left_li_time"> {{ item.updated_at }}</div>
  9. <h4 class="list_left_li_h4">{{ item.title }}</h4>
  10. </div>
  11. <div class="list_left_li_dot3"> {{ item.introduce }}</div>
  12. </NuxtLink>
  13. </div>
  14. </div>
  15. <div v-if="componentStyle == 2">
  16. <div class="list_left_li_2" v-for="item in listData.slice(0, 10)">
  17. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
  18. :target="item.islink == 1 ? '_blank' : '_self'">
  19. <div class="list_left_li_head">
  20. <div class="list_left_li_time"> {{ item.updated_at }}</div>
  21. <h4 class="list_left_li_h4">{{ item.title }}</h4>
  22. </div>
  23. <div class="list_left_li_dot3"> {{ item.introduce }}</div>
  24. </NuxtLink>
  25. </div>
  26. </div>
  27. <div v-if="componentStyle == 3">
  28. <div class="list_left_li_3" v-for="item in listData.slice(0, 10)">
  29. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
  30. :target="item.islink == 1 ? '_blank' : '_self'">
  31. <div class="list_left_li_head">
  32. <div class="list_left_li_time"> {{ item.updated_at }}</div>
  33. <h4 class="list_left_li_h4">{{ item.title }}</h4>
  34. </div>
  35. <div class="list_left_li_dot3"> {{ item.introduce }}</div>
  36. </NuxtLink>
  37. </div>
  38. </div>
  39. <div v-if="componentStyle == 4">
  40. <div class="list_left_li_4" v-for="item in listData.slice(0, 10)">
  41. <NuxtLink :href="getLinkPathDetail(item)" :title="item.title" class="list_left_li_a"
  42. :target="item.islink == 1 ? '_blank' : '_self'">
  43. <div class="list_left_li_head">
  44. <div class="list_left_li_time"> {{ item.updated_at }}</div>
  45. <h4 class="list_left_li_h4">{{ item.title }}</h4>
  46. </div>
  47. <div class="list_left_li_dot3"> {{ item.introduce }}</div>
  48. </NuxtLink>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. //引入vue
  55. import { ref } from 'vue';
  56. //获得新闻数据
  57. const props = defineProps({
  58. listData: Array,//新闻数据
  59. componentStyle: Number//组件样式
  60. });
  61. </script>
  62. <style lang="less" scoped>
  63. .list_left_li_1 {
  64. box-sizing: border-box;
  65. width: 100%;
  66. overflow: hidden;
  67. height: 140px;
  68. border: solid 1px rgba(0, 0, 0, 0);
  69. border-bottom: dashed 1px #999;
  70. .list_left_li_a {
  71. display: block;
  72. width: 100%;
  73. height: 100%;
  74. }
  75. .list_left_li_head {
  76. height: 24px;
  77. margin-top: 20px;
  78. }
  79. .list_left_li_time {
  80. float: right;
  81. height: 24px;
  82. line-height: 24px;
  83. color: #999;
  84. font-size: 18px;
  85. margin-left: 20px;
  86. }
  87. .list_left_li_h4 {
  88. height: 24px;
  89. display: block;
  90. line-height: 24px;
  91. color: #333;
  92. font-size: 18px;
  93. position: relative;
  94. font-weight: bold;
  95. text-indent: 16px;
  96. margin: 0;
  97. display: block;
  98. word-break: keep-all;
  99. white-space: nowrap;
  100. overflow: hidden;
  101. text-overflow: ellipsis;
  102. }
  103. .list_left_li_h4::after {
  104. content: "";
  105. position: absolute;
  106. top: 10px;
  107. left: 0px;
  108. width: 6px;
  109. height: 6px;
  110. background: #F2F2F2;
  111. }
  112. .list_left_li_dot3 {
  113. height: 63px;
  114. line-height: 21px;
  115. color: #999;
  116. font-size: 16px;
  117. width: 100%;
  118. box-sizing: border-box;
  119. padding-left: 16px;
  120. margin-top: 15px;
  121. overflow: hidden;
  122. display: -webkit-box !important;
  123. -webkit-box-orient: vertical;
  124. -webkit-line-clamp: 3;
  125. }
  126. &:nth-child(1) {
  127. height: 120px;
  128. }
  129. &:nth-child(1) .list_left_li_head {
  130. margin-top: 0px;
  131. }
  132. }
  133. .list_left_li_2 {
  134. box-sizing: border-box;
  135. width: 100%;
  136. overflow: hidden;
  137. height: 140px;
  138. border: solid 1px rgba(0, 0, 0, 0);
  139. border-bottom: solid 1px #999;
  140. .list_left_li_a {
  141. display: block;
  142. width: 100%;
  143. height: 100%;
  144. }
  145. .list_left_li_head {
  146. height: 24px;
  147. margin-top: 20px;
  148. }
  149. .list_left_li_time {
  150. float: right;
  151. height: 24px;
  152. line-height: 24px;
  153. color: #999;
  154. font-size: 18px;
  155. margin-left: 20px;
  156. }
  157. .list_left_li_h4 {
  158. height: 24px;
  159. display: block;
  160. line-height: 24px;
  161. color: #333;
  162. font-size: 18px;
  163. position: relative;
  164. font-weight: bold;
  165. text-indent: 16px;
  166. margin: 0;
  167. display: block;
  168. word-break: keep-all;
  169. white-space: nowrap;
  170. overflow: hidden;
  171. text-overflow: ellipsis;
  172. }
  173. .list_left_li_h4::after {
  174. content: "";
  175. position: absolute;
  176. top: 10px;
  177. left: 0px;
  178. width: 6px;
  179. height: 6px;
  180. background: #F2F2F2;
  181. }
  182. .list_left_li_dot3 {
  183. height: 63px;
  184. line-height: 21px;
  185. color: #999;
  186. font-size: 16px;
  187. width: 100%;
  188. box-sizing: border-box;
  189. padding-left: 16px;
  190. margin-top: 15px;
  191. overflow: hidden;
  192. display: -webkit-box !important;
  193. -webkit-box-orient: vertical;
  194. -webkit-line-clamp: 3;
  195. }
  196. &:nth-child(1) {
  197. height: 120px;
  198. }
  199. &:nth-child(1) .list_left_li_head {
  200. margin-top: 0px;
  201. }
  202. }
  203. .list_left_li_3 {
  204. box-sizing: border-box;
  205. width: 100%;
  206. overflow: hidden;
  207. height: 140px;
  208. border: solid 1px rgba(0, 0, 0, 0);
  209. border-bottom: dashed 1px #999;
  210. .list_left_li_a {
  211. display: block;
  212. width: 100%;
  213. height: 100%;
  214. }
  215. .list_left_li_head {
  216. height: 24px;
  217. margin-top: 20px;
  218. }
  219. .list_left_li_time {
  220. float: right;
  221. height: 24px;
  222. line-height: 24px;
  223. color: #999;
  224. font-size: 18px;
  225. margin-left: 20px;
  226. }
  227. .list_left_li_h4 {
  228. height: 24px;
  229. display: block;
  230. line-height: 24px;
  231. color: #333;
  232. font-size: 18px;
  233. position: relative;
  234. font-weight: normal;
  235. text-indent: 16px;
  236. margin: 0;
  237. display: block;
  238. word-break: keep-all;
  239. white-space: nowrap;
  240. overflow: hidden;
  241. text-overflow: ellipsis;
  242. }
  243. .list_left_li_h4::after {
  244. content: "";
  245. position: absolute;
  246. top: 10px;
  247. left: 0px;
  248. width: 6px;
  249. height: 6px;
  250. background: #F2F2F2;
  251. }
  252. .list_left_li_dot3 {
  253. height: 63px;
  254. line-height: 21px;
  255. color: #999;
  256. font-size: 16px;
  257. width: 100%;
  258. box-sizing: border-box;
  259. padding-left: 16px;
  260. margin-top: 15px;
  261. overflow: hidden;
  262. display: -webkit-box !important;
  263. -webkit-box-orient: vertical;
  264. -webkit-line-clamp: 3;
  265. }
  266. &:nth-child(1) {
  267. height: 120px;
  268. }
  269. &:nth-child(1) .list_left_li_head {
  270. margin-top: 0px;
  271. }
  272. }
  273. .list_left_li_4 {
  274. box-sizing: border-box;
  275. width: 100%;
  276. overflow: hidden;
  277. height: 140px;
  278. border: solid 1px rgba(0, 0, 0, 0);
  279. border-bottom: solid 1px #999;
  280. .list_left_li_a {
  281. display: block;
  282. width: 100%;
  283. height: 100%;
  284. }
  285. .list_left_li_head {
  286. height: 24px;
  287. margin-top: 20px;
  288. }
  289. .list_left_li_time {
  290. float: right;
  291. height: 24px;
  292. line-height: 24px;
  293. color: #999;
  294. font-size: 18px;
  295. margin-left: 20px;
  296. }
  297. .list_left_li_h4 {
  298. height: 24px;
  299. display: block;
  300. line-height: 24px;
  301. color: #333;
  302. font-size: 18px;
  303. position: relative;
  304. font-weight: normal;
  305. text-indent: 16px;
  306. margin: 0;
  307. display: block;
  308. word-break: keep-all;
  309. white-space: nowrap;
  310. overflow: hidden;
  311. text-overflow: ellipsis;
  312. }
  313. .list_left_li_h4::after {
  314. content: "";
  315. position: absolute;
  316. top: 10px;
  317. left: 0px;
  318. width: 6px;
  319. height: 6px;
  320. background: #F2F2F2;
  321. }
  322. .list_left_li_dot3 {
  323. height: 63px;
  324. line-height: 21px;
  325. color: #999;
  326. font-size: 16px;
  327. width: 100%;
  328. box-sizing: border-box;
  329. padding-left: 16px;
  330. margin-top: 15px;
  331. overflow: hidden;
  332. display: -webkit-box !important;
  333. -webkit-box-orient: vertical;
  334. -webkit-line-clamp: 3;
  335. }
  336. &:nth-child(1) {
  337. height: 120px;
  338. }
  339. &:nth-child(1) .list_left_li_head {
  340. margin-top: 0px;
  341. }
  342. }
  343. </style>