mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-17 14:28:25 +00:00
18 lines
448 B
TypeScript
18 lines
448 B
TypeScript
import { useFetch } from '@vueuse/core';
|
|
import { computed, Ref } from 'vue';
|
|
|
|
const useFetchVersionIcons = (version: Ref<string | undefined>) =>{
|
|
const fetchUrl = computed(() => {
|
|
if(version.value == null ) return ''
|
|
return `https://unpkg.com/lucide-static@${version.value}/icon-nodes.json`
|
|
})
|
|
return useFetch<Record<string, string>>(
|
|
fetchUrl,
|
|
{
|
|
refetch: true
|
|
}
|
|
).json();
|
|
}
|
|
|
|
export default useFetchVersionIcons;
|