refactor(list): improve type
This commit is contained in:
parent
088398cba5
commit
8b9ef37f0b
1 changed files with 5 additions and 2 deletions
|
@ -16,10 +16,13 @@ const items: Item[] = [
|
||||||
const highlight = ref("anything")
|
const highlight = ref("anything")
|
||||||
|
|
||||||
// https://www.lichter.io/articles/nuxt3-vue3-dynamic-images/
|
// 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(
|
const thumbnails = Object.fromEntries(
|
||||||
Object.entries(glob).map(([key, value]) => [
|
Object.entries(glob).map(([key, value]) => [
|
||||||
key.split("/").pop().split(".")[0],
|
key.split("/").pop()!.split(".")[0],
|
||||||
value.default,
|
value.default,
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue