From 97b211638929293c068eeb7e72862dd5e60adc90 Mon Sep 17 00:00:00 2001 From: Ewout Verlinde Date: Wed, 10 Apr 2024 10:19:04 +0200 Subject: [PATCH] Glob import fix (#285) * fix: glob imports * chore: linting --- .../components/courses/CourseDetailCard.vue | 12 +-- .../components/courses/CourseGeneralCard.vue | 24 +----- .../src/components/projects/ProjectList.vue | 77 ++++++++++++------- frontend/src/composables/glob.ts | 42 ++++++++++ .../dashboard/roles/StudentDashboardView.vue | 2 +- 5 files changed, 100 insertions(+), 57 deletions(-) create mode 100644 frontend/src/composables/glob.ts diff --git a/frontend/src/components/courses/CourseDetailCard.vue b/frontend/src/components/courses/CourseDetailCard.vue index dc5689c9..fae89e68 100644 --- a/frontend/src/components/courses/CourseDetailCard.vue +++ b/frontend/src/components/courses/CourseDetailCard.vue @@ -4,6 +4,7 @@ import Button from 'primevue/button'; import { type Course } from '@/types/Course.ts'; import { PrimeIcons } from 'primevue/api'; import { useI18n } from 'vue-i18n'; +import { useGlob } from '@/composables/glob.ts'; /* Component props */ defineProps<{ @@ -12,14 +13,7 @@ defineProps<{ /* Composable injections */ const { t } = useI18n(); - -/* Default image thumbnails */ -const images = Object.keys( - import.meta.glob('@/assets/img/placeholders/*', { - eager: true, - query: 'url', - }), -); +const { getRandomImport } = useGlob(import.meta.glob('@/assets/img/placeholders/*.png', { eager: true }));