1.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div class="listNewsBox">
  3. <div v-for="item in listData.data.rows">
  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. &:first-child {
  35. font-weight: bold;
  36. }
  37. &:nth-child(5n) {
  38. height: 54px;
  39. //padding-bottom:30px;
  40. border-bottom: 1px solid #D9D9D9;
  41. }
  42. &:nth-child(5n+1) {
  43. font-weight: bold;
  44. margin-top: 30px;
  45. }
  46. span {
  47. float: right;
  48. }
  49. &:last-child {
  50. margin-bottom: 0;
  51. }
  52. }
  53. }
  54. </style>