blog.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. <NuxtLink to="/register">
  35. <common-blog-item :item="item" />
  36. </NuxtLink>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <style lang='less' scoped>
  43. .custom-title-bg{
  44. position: relative;
  45. display: inline-block;
  46. background: url(~/assets/images/title_bg03.png);
  47. background-repeat: no-repeat;
  48. background-position: center 100%;
  49. background-size: 100% auto;
  50. padding-bottom: 8px;
  51. }
  52. </style>