refactor(list): improve type

This commit is contained in:
Kim, Jimin 2025-03-23 08:48:03 +09:00
parent 088398cba5
commit 8b9ef37f0b
Signed by: pomp
GPG key ID: D3932F82A0667A3B

View file

@ -16,10 +16,13 @@ const items: Item[] = [
const highlight = ref("anything")
// https://www.lichter.io/articles/nuxt3-vue3-dynamic-images/
const glob = import.meta.glob("~/assets/thumbnail/*", { eager: true })
const glob: Record<string, { default: string }> = import.meta.glob(
"~/assets/thumbnail/*",
{ eager: true },
)
const thumbnails = Object.fromEntries(
Object.entries(glob).map(([key, value]) => [
key.split("/").pop().split(".")[0],
key.split("/").pop()!.split(".")[0],
value.default,
]),
)