import {api} from '@/store/sync' import {Ref, ref} from "vue"; const cache = new Map>() export const useStaticUrl = (url) => { if (cache.has(url)) { return cache.get(url); } else { const realUrl = ref() api.getFile(url) .then(data => { realUrl.value = data cache.set(url, realUrl) }) return realUrl } }