1.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="listNewsBox">
  3. <div v-for="item in listData">
  4. <NuxtLink
  5. :href="getLinkPathDetail(item)"
  6. :title="item.title"
  7. :target="item.islink == 1 ? '_blank' : '_self'"
  8. >
  9. {{item.title}}
  10. <span>{{getTime(item.updated_at, 'month', 1)}}</span>
  11. </NuxtLink>
  12. </div>
  13. </div>
  14. </template>
  15. <script setup>
  16. //引入vue
  17. import {ref} from 'vue';
  18. //获得新闻数据
  19. const props = defineProps({
  20. listData:Array//新闻数据
  21. });
  22. </script>
  23. <style lang="less" scoped>
  24. .listNewsBox {
  25. div{
  26. height: 24px;
  27. line-height: 24px;
  28. color:#333333;
  29. font-size:18px;
  30. margin-bottom: 20px;
  31. a {
  32. color:#333333;
  33. }
  34. &:nth-child(5n) {
  35. height: 54px;
  36. //padding-bottom:30px;
  37. border-bottom: 1px solid #D9D9D9;
  38. }
  39. &:nth-child(5n+1) {
  40. font-weight: bold;
  41. margin-top: 30px;
  42. }
  43. &:first-child {
  44. font-weight: bold;
  45. margin-top: 0;
  46. }
  47. span {
  48. float: right;
  49. }
  50. &:last-child {
  51. margin-bottom: 0;
  52. }
  53. }
  54. }
  55. </style>