You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1.4 KiB

  1. <template>
  2. <ArticleListView
  3. :col-id="2"
  4. :heading="heading"
  5. subtitle="AI 工具使用教程与实操指南,从入门到进阶,手把手带你用好各类 AI 能力。"
  6. base-path="/info/course"
  7. :page="page"
  8. :page-size="PAGE_SIZE"
  9. :list="data?.list || []"
  10. :total="data?.total || 0"
  11. :hot-list="data?.hotList || []"
  12. :tag-list="data?.tagList || []"
  13. :pending="pending"
  14. />
  15. </template>
  16. <script setup>
  17. import { useArticleData } from '~/composables/useArticle'
  18. import {
  19. LEGACY_DEFAULT_DESCRIPTION,
  20. LEGACY_DEFAULT_KEYWORDS,
  21. legacyPageTitle,
  22. } from '~/composables/useLegacySeo'
  23. const PAGE_SIZE = 10
  24. const route = useRoute()
  25. const page = computed(() => Number(route.params.page || route.query.page || 1))
  26. const { data, pending } = await useArticleData({
  27. key: computed(() => `info-course-${page.value}`),
  28. colId: 2,
  29. page,
  30. pageSize: PAGE_SIZE,
  31. })
  32. const heading = computed(() => (page.value > 1 ? `使用教程(第 ${page.value} 页)` : '使用教程'))
  33. const title = computed(() =>
  34. legacyPageTitle(page.value > 1 ? `使用教程-第${page.value}页` : '使用教程'))
  35. useSeoMeta({
  36. title,
  37. description: LEGACY_DEFAULT_DESCRIPTION,
  38. keywords: LEGACY_DEFAULT_KEYWORDS,
  39. ogTitle: title,
  40. ogType: 'website',
  41. })
  42. useHead({
  43. link: [{ rel: 'canonical', href: () => `https://tool.aionline.cc${page.value > 1 ? `/info/course${page.value}` : '/info/course'}` }],
  44. })
  45. </script>