blog.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 class="bg-#fff pt-160px pb-120px">
  21. <div class="w-1200-auto text-center">
  22. <h2 class="!text-36px !fw-800 text-#333 !mb-44px">
  23. EJET Spark <span class="custom-title-bg">Blog</span>
  24. </h2>
  25. <div class="flex items-center justify-end text-#9B6CFF cursor-pointer text-14px fw-bold mb-20px">
  26. View All
  27. <svgo-arrow-line-r class="w-16px h-16px ml-10px" />
  28. </div>
  29. <div class=" grid grid-cols-3 gap-40px text-left">
  30. <div v-for="item, index in list" :key="index">
  31. <NuxtLink to="/register">
  32. <common-blog-item :item="item" />
  33. </NuxtLink>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <style lang='less' scoped>
  40. .custom-title-bg{
  41. position: relative;
  42. display: inline-block;
  43. background: url(~/assets/images/title_bg03.png);
  44. background-repeat: no-repeat;
  45. background-position: center 100%;
  46. background-size: 100% auto;
  47. padding-bottom: 8px;
  48. }
  49. </style>