blog.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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">
  26. EJET Spark <span class="custom-title-bg">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. .custom-title-bg{
  42. position: relative;
  43. display: inline-block;
  44. background: url(~/assets/images/title_bg03.png);
  45. background-repeat: no-repeat;
  46. background-position: center 100%;
  47. background-size: 100% auto;
  48. padding-bottom: 8px;
  49. }
  50. </style>