blog.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <script lang='ts' setup>
  2. import {
  3. getBlogsListApi,
  4. } from '~/api/model/blogs'
  5. const list = ref<any>([])
  6. async function getVideoOrBlogsList(pageNo = 1, pageSize = 3) {
  7. const params = {
  8. pageNo,
  9. pageSize,
  10. categoryId: '',
  11. orderBy: 'createTime',
  12. orderType: 'desc',
  13. }
  14. const res: any = await getBlogsListApi(params)
  15. list.value = res.records
  16. }
  17. getVideoOrBlogsList()
  18. </script>
  19. <template>
  20. <div
  21. class="bg-#fff py-120px data-section"
  22. data-section-color="#ffffff"
  23. >
  24. <div class="w-1200-auto text-center">
  25. <h2 class="!text-36px !fw-800 text-#333 !mb-44px custom-title-font">
  26. EJET Spark <span class="custom-title-bg03">Blog</span>
  27. </h2>
  28. <div class="flex items-center justify-end text-#9B6CFF cursor-pointer text-14px fw-bold mb-20px">
  29. View All
  30. <svgo-arrow-line-r class="w-16px h-16px ml-10px" />
  31. </div>
  32. <div class=" grid grid-cols-3 gap-40px text-left">
  33. <div v-for="item, index in list" :key="index">
  34. <common-blog-item :item="item" />
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <style lang='less' scoped>
  41. </style>